+0  
 
0
303
1
avatar

We have a dictionary consisting of 106 words. If we use a binary tree as a spell checker, estimate how many checks might be required to test whether "name" is a valid word.

Guest May 27, 2017
 #1
avatar+17743 
+1

It takes at most  n  checks to find an item in a field of  2n - 1  items.

 

When  n = 6,  26 - 1  =  63

When  n = 7,  27 - 1  =  127

 

So, if you have 106 words, it will take a binary search at most 7 checks.

geno3141  May 27, 2017

4 Online Users

New Privacy Policy

We use cookies to personalise content and advertisements and to analyse access to our website. Furthermore, our partners for online advertising receive information about your use of our website.
For more information: our cookie policy and privacy policy.