Binary search tree (bst), Data Structure & Algorithms

Q. Explain what do we understand by Binary Search Tree (BST)? Make a BST for the following given sequence of the numbers.

45, 32, 90, 21, 78, 65, 87, 132, 90, 96, 41, 74, 92                                 

Ans.

Binary search tree is explained below.

A binary search tree is a binary tree which is either empty or in which each node has a key that satisfies the below written conditions : -

All keys (if there are any) in the left sub tree of the root head the key in the root.

The key in the root heads all keys (if there are any) in its right sub tree.

The left and right sub trees of the root are again the search trees. The  tree for the following list of numbers is drawn below

45      32   90   21   78   65   87   132  90  96   41   74 92

375_search tree.png

Posted Date: 7/13/2012 2:52:31 AM | Location : United States







Related Discussions:- Binary search tree (bst), Assignment Help, Ask Question on Binary search tree (bst), Get Answer, Expert's Help, Binary search tree (bst) Discussions

Write discussion on Binary search tree (bst)
Your posts are moderated
Related Questions
MID SQUARE METHOD

circular queue using c

This method is the reverse of FIFO and assumes that each issue of stock is made from latest items received in the enterprises .Thus if the last lot to be received is not sufficient

I was wanting to know where this web site was created. My second question is,,, are the online tuters accredited teachers? If they are, are they only working for the website or ma

In a chained hash table, each table entry is a pointer to a collection of elements. It can be any collection that supports insert, remove, and find, but is commonly a linked list.

algorithm for insertion in a queue using pointers

We might sometimes seek a tradeoff among space & time complexity. For instance, we may have to select a data structure which requires a lot of storage to reduce the computation tim

Q. Define a method for keeping two stacks within a single linear array S in such a way that neither stack overflows until entire array is used and a whole stack is never shifted to

(a) Explain the term Group Support System and elaborate on how it can improve groupwork. (b) Briefly explain three advantages of simulation. (c) Explain with the help of a

Description A heap is an efficient tree-based data structure that can be used as a priority queue. Recall that the abstract data type of a priority queue has the following opera