Question: *************************************************PLEASE USE AN ARRAY AND NOT A POINTER***************************************************** Construct Binary Search Tree by Array Executive Summary: A binary search tree is a binary tree in


*************************************************PLEASE USE AN ARRAY AND NOT A POINTER*****************************************************
Construct Binary Search Tree by Array Executive Summary: A binary search tree is a binary tree in which every node satisfies the following: the key of every node in the lefi subtree is smaller than the key of this node the key of every node in the right subtree is larger than the key of this node . It is possible to construct BST with pointers. A single dimension array is also good enough to construct a BST. One example is like following: 3) (8 =|538| 1 4 -119 1) (4 9 Staring with array index "l For any node, to find its parent's index: If the node's index is even numberindex/2 If the node's index is odd number -- (index-1)/2 For any node, to find its left side child's index -- index*2 For any node, to find its right side child's index -- index*2+1 Project Objective: in completing this project, you will Understand the details of BST, including search, insert, delete, find max, find min Familiar with the links between array and BST
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
