Guys... very interesting discussion... but how's this helping the OP?
Guys... very interesting discussion... but how's this helping the OP?
It would work "Okay" as a circular buffer, and even then only if iterations were few and far between, but that's about it.Depending on what such a list does contain - possibly a lot. Maybe it would be a message queue? Networking protocol stack? Maybe a slab memory pool, who knows.
If you are trying to get some magic locality of reference going, you should maybe look into specific types of skip lists; specifically those built by aiming at a "Trie".
[Edit]
While I'm here, I feel compelled to point out that your source is horribly broken.
It doesn't actually "store" much.
[/Edit]
Soma
Last edited by phantomotap; 09-23-2011 at 04:46 AM.
Unless you plan on suggesting that a newbie implement hash maps, I'd say the suggestion to combine the string and the frequency in a structure is about the best he can do with what he has.Guys... very interesting discussion... but how's this helping the OP?
Soma
Since it looks like the OP has not been interested in commenting this topic lately, I would like to ask which part of my source was so horribly broken? I simply do not spot that myself. So please someone point that out for me? (I asked phantomotap to do it via PM, but got answer telling me to find it out by testing the source - I tried it out and still did not spot the weak part :/ )
Obsession to networking and protocols made me cook up these:
NSN - Network Status Notifier
epb - Ethernet Packet Bombardier
T.H.O.N.G.S - Textmode Helper On Network Getting Sniffed
Nibbles - console UDP print listener/filter + something else
Feel free to try, comment and improve =)
Thanks for all your help, guys. I figured out the rest, and it's working.