TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
Advice on appropriate datastructure
Mar 18 2003 3:37 PM
Hi everyone, I've got a bunch of related tables I'm retreiving data from, and end result is I end up with a bunch of (key,value) pairs for an object. So one object might have: total, 10 tax1, 2 and another object might have these values: total, 20 tax1, 4 tax2, 3 In the end, I want to sum up all the common fields in my returned objects so I've got something like: total, 30 tax1, 6 tax2, 3 And I want to display this final info in a form. The question is, what is the best datastructure to store everything in? I thought of a 2-dimensional array, but then I end up going through a lot of loops to add everything up later (checking key fields, adding up value fields if equal, etc). Then I thought maybe an extended hashtable class with the add() method overridden, but I'm not sure how to do that. Any suggestions?
Reply
Answers (
2
)
Cleaning up
play wav