Question: Write a program in C++ for binary tree that implement following methods: Create(P, X) : P is location of parent of node which is to

Write a program in C++ for binary tree that implement following methods: Create(P, X) : P is location of parent of node which is to be created, X is either Left or Right.

Delete(N): N is location of node which is to be deleted. If the node to be deleted is an internal node, fill the space vacated by deleted node by moving the last node (rightmost node at the last level) to the vacant space.

Display() : display the entire binary tree (information and location of each node, location of its left and right children)

Search(v): v is some value, search all node(s) n having value equal to v and print the location of those node(s). Also print the location of parent of those node(s). Also, implement the inorder, preorder and postorder traversal of binary tree. Your program should implement two classes. One class should use sequential representation. Second class should use linked representation using arrays.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!