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:

  1. you guessed right.
  2. 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:

https://en.wikipedia.org/wiki/binary_search_algorithm


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -