Name: Anonymous 2010-05-16 5:14
Sup /prog/, I need to an indexed data structure that supports these methods:
I can do this with a (Doubly/Double) Linked List, but the search/retrieval is O(n). Is a HashTable a better structure?
Thanks
void addLast(S stuff); // insertion's like a queue
void removeLast(); // removes last link
void removeIfHas(S stuff); // removes link if has target stuff
S getStuff(int index); // retrieves stuff given the indexI can do this with a (Doubly/Double) Linked List, but the search/retrieval is O(n). Is a HashTable a better structure?
Thanks