Reputation: 141
I am required to implement general dictionary using Java that will allow efficient O(logN) or better insertions, deletions and random access.
My question is: what type of tree will give me the best time performance for a huge amount of insertions and deletions? AVL, RB, Binary Search, Splay or B-Trees?
Upvotes: 1
Views: 842
Reputation: 105
You can use trie data structure for implementing dictionary.For implementing it first you have to create trie which will take O(nlogn) time.After that you can search,insert & delete word in O(logn). For more understanding you can refer NPTEL LINK,which contain basic of tire data structure.
Upvotes: 1