|
-
May 28th, 2010, 05:47 PM
#4
Re: Can a Hash Table Track Multiple Items of Information?
Hi everyone,
Thanks for taking the time to read this post! I'll try to answer your thoughts as directly as I can...
Lindley, the best example is this: Suppose my raw data is the amount of fruit sold at individual fruit carts all across the country. The data format of one line of the raw data could look like this:
CART / Apples / Oranges / Bananas / Watermellons / Pears / Mangos / etc.
So suppose the first few lines of the raw data looked like this:
00001,0,0,2,0,0,8,...
00002,0,1,0,0,3,0,...
00003,0,1,1,4,0,0,...
This would mean Fruit Cart 00001 sold two bananas and eight mangos, Fruit Cart 00002 sold one orange and three pears, and so on.
I need to crunch all of this information down into a more compact form. Final output would look like:
Total Carts: 100,000
Apples: 3,000,000
Oranges: 7,000,000
Bananas: 1,000,000
Watermellons: 150,000
Pears: 4,000,000
Mangos: 3,000,000
See what I'm trying to do? The most serious limitation I have is I don't know how many fruit carts there are (probably millions, actually) and I also don't know how many types of fruit there are either (probably hundreds of thousands)
The heart of my question is, "How do I do all this tallying on-the-fly in a hash table?"
Many thanks all!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|