3 ms·
Regarding the speed vs memory occupation, there should be comparison between linkedlist vs. hashmap. I remember that linkedlist is faster. So it depends on the
by dclara 13y ago
Regarding the speed vs memory occupation, there should be comparison between linkedlist vs. hashmap. I remember that linkedlist is faster. So it depends on the language support.
You can google it more. I don't have time to find out about the Big O footprint for both now. Here is one link discussing about it:
http://stackoverflow.com/questions/7975802/when-to-use-hashmap-over-linkedlist-or-arraylist-and-vice-versa http://stackoverflow.com/questions/7975802/when-to-use-hashm...
- duaneb 13y agoLinear lists are.... linear. Hash maps are constant access. N doesn't need to get very large to see orders of magnitude difference—one you'll certainly see if you switch on level0.
- cmelbye 13y agoA linked list is not faster than a hash in looking up an element. The operation is O(N) for a linked list and O(1) for a hash.