Hey everyone, I'm planning to implement a dictionary on C#. I have about 30,000 words in my database( i keep them in access database right now. Maybe we can make a decision about which database it should be. )
a word and a definition may contain from 1 to 25-30 chars.
The search should work like that ; when user types a, the app should find all the words starting with a.
So the algorithms that i thought about are;
1-) Binarysearch will fail, since there might be some duplicate elements.
2-) Binary Search Tree will fail, since i have all the words in ascending order, when i add the words to the tree, it will be an unbalanced tree( more likely a linked list ) So the performance will be O(n)
3-) Ternary Search Tree, dunno yet if i'll be ok to implement a function that finds the word starts with(...)(to find any word when user starts typing something . for example when the user type "hello" it should search for h, he, hel, hell, hello. It will definitely be so fast for finding exact word. ( and also will work fine for misspelling situations )
4-) Or should i use hash tables ?
Could please gimme some ideas. I couldnt make a decision between these things. Which one will be better or is there any other algorithm for dictionaries that you know.
Thanks in advance.