4 ms·
>I always had trouble understanding why we are learning such hard topics to find the number 5 in a sorted list of 10 numbers. It is left up to the learner to r
by IncRnd 4y ago
>I always had trouble understanding why we are learning such hard topics to find the number 5 in a sorted list of 10 numbers.
It is left up to the learner to realize that the list of 10 numbers can be either the left side or right side of a higher node, showing that any binary search of 10 numbers works on 20 numbers and hence on any size sorted-list. Then, it becomes clear why the average search space decrease from N to log n.
Many people find binary search to be a valuable algorithm to use in practice.