1.

Can You Provide Some Implementation Of A Dictionary Having Large Number Of Words ?

Answer»

Simplest implementation we can have is a List wherein we can PLACE ordered WORDS and HENCE can perform Binary Search.

Other implementation with better search performance is to use HashMap with key as first character of the WORD and value as a LinkedList.

Further level up, we can have linked Hashmaps like ,

hashmap {

a ( key ) -> hashmap (key-aa , value (hashmap(key-aaa,value)

b ( key ) -> hashmap (key-ba , value (hashmap(key-baa,value)

....................................................................................

z( key ) -> hashmap (key-za , value (hashmap(key-zaa,value)

}

upto n levels ( where n is the average size of the word in dictionary.

Simplest implementation we can have is a List wherein we can place ordered words and hence can perform Binary Search.

Other implementation with better search performance is to use HashMap with key as first character of the word and value as a LinkedList.

Further level up, we can have linked Hashmaps like ,

hashmap {

a ( key ) -> hashmap (key-aa , value (hashmap(key-aaa,value)

b ( key ) -> hashmap (key-ba , value (hashmap(key-baa,value)

....................................................................................

z( key ) -> hashmap (key-za , value (hashmap(key-zaa,value)

}

upto n levels ( where n is the average size of the word in dictionary.



Discussion

No Comment Found