Required Task: Complete the implementation of deletion functionality of Binary Search Tree: Delete by merge. Delete by copy. Problem Statement Create a structure named Node
Required Task: Complete the implementation of deletion functionality of Binary Search Tree: Delete by merge. Delete by copy. Problem Statement Create a structure named Node that contains int key and a pointer to left and right nodes. Create class named BST that contains a pointer to the root of the tree, and the following functionalities (from previous task): constructor: Initialize member data. addNode: Add a new node to the BST. printAllNodes: Print all Nodes to the screen in a post order traversing. searchNode: Search a node by its key value. kthSmallestKey: return the value of the kth smallest key in the BST, where 1 k N. deleteNode: Delete Node from the BST according to its value. Implementation Start your main program as follows: Create an object of type BST. Create a menu of BST functionalities
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started