World's most popular travel blog for travel bloggers.

Is Binary Search Related to Binary Search Tree?

, , No Comments
Problem Detail: 

I was reading binary search and suddenly realized that it would be very difficult for a binary search tree to find the middle value and then split in two. Are these related at all?

Asked By : John Swoon
Answered By : Yuval Filmus

A balanced binary search tree describes the working of the binary search algorithm on a sorted list. The root should contain the middle element, the left subtree the left half, the right subtree the right half, and so on recursively. The tree also has to be balanced, that is, to reflect the fact that we chose the middle element as the root. In this sense, a binary search tree is a generalization of binary search on a sorted list.

Best Answer from StackOverflow

Question Source :

3200 people like this

 Download Related Notes/Documents


Post a Comment

Let us know your responses and feedback