Binary search tree (bst), Data Structure & Algorithms

Assignment Help:

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


Related Discussions:- Binary search tree (bst)

Selection sort, how to reduce the number of passes in selection sort

how to reduce the number of passes in selection sort

Lists, In the previous unit, we have discussed arrays. Arrays are data stru...

In the previous unit, we have discussed arrays. Arrays are data structures of fixed size. Insertion and deletion involves reshuffling of array elements. Thus, array manipulation

Dijkstras algorithm, Djikstra's algorithm (named after it is discovered by ...

Djikstra's algorithm (named after it is discovered by Dutch computer scientist E.W. Dijkstra) resolves the problem of finding the shortest path through a point in a graph (the sour

What is a linear array, What is a linear array? An array is a way to re...

What is a linear array? An array is a way to reference a series of memory locations using the similar name. Every memory location is shown by an array element. An  array elemen

Explain the scan-line algorithm, Explain the Scan-Line Algorithm This i...

Explain the Scan-Line Algorithm This image-space method for removing hidden surfaces is an extension of the scan-line algorithm for filling polygon interiors. Instead of fillin

Darw a flowchart to inputs top speeds of 5000 cars, Write an algorithm in t...

Write an algorithm in the form of a flowchart that: inputs top speeds (in km/hr.) of 5000 cars Outputs fastest speed and the slowest speed Outputs average (mean) s

Avl tree rotations, AVL trees and the nodes it contains must meet strict ba...

AVL trees and the nodes it contains must meet strict balance requirements to maintain O(log n) search time. These balance restrictions are kept maintained via various rotation func

Order of linear search, a. In worst case the order of linear search is O (n...

a. In worst case the order of linear search is O (n/2) b. Linear search is more competent than Binary search. c. For Binary search, the array must be sorted in ascending orde

Quick sort, This is the most extensively used internal sorting algorithm. I...

This is the most extensively used internal sorting algorithm. In its fundamental form, it was invented by C.A.R. Hoare in the year of 1960. Its popularity lies in the easiness of i

Technique for direct search, Technique for direct search is    Hashing ...

Technique for direct search is    Hashing is the used for direct search.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd