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
A freight train from Melbourne is approaching Sydney, carrying n cars of cargos. The cargos are to be delivered to n different cities in the metropolitan area of Sydney - one car f

Q. Write down the algorithm which does depth first search through an un-weighted connected graph. In an un-weighted graph, would breadth first search or depth first search or neith

Use a random number generator to create 10 numbers between 1 and 1000 and store them in 2 different arrays.  The first array should contain the numbers as they are generated.  The

Binary search technique:-  This technique is applied to an ordered list where elements are arranged either in ascending order or descending order. The array is separated into t

Question 1 What is a data structure? Discuss briefly on types of data structures Question 2 Explain the insertion and deletion operation of linked list in detail Qu

Determine in brief about the Boolean Carrier set of the Boolean ADT is the set {true, false}. Operations on these values are negation, conjunction, disjunction, conditional,


how to design a cache simulator with 4-way set associative cache

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

Difference between array and abstract data types Arrays aren't abstract data types since their arrangement in the physical memory of a computer is an essential feature of their