data structures - Decision Tree Problems to solve -
i have exam on data structures , i've been looking on place problems solved using decision trees (sorting n elements in minimum of nlog n w.c). if can provide me sources such questions happy. in advance.
of course, let's consider case when have guess number between 1 , 1024 , whenever guess, there 2 possibilities:
- you guessed right.
- you guessed wrong.
in case of 1., algorithm finishes, have found answer. in case of 2., have further decision:
2.1. number searching smaller guess 2.2. number searching greater guess
so, if model binary search, work simple, repeat same idea finite number of times. read more binary search here:
Comments
Post a Comment