Q1: Write a C++ program to implement a Binary Search Tree. Your program must allow the user to perform the following tas

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Q1: Write a C++ program to implement a Binary Search Tree. Your program must allow the user to perform the following tas

Post by answerhappygod »

Q1:
Write a C++ program to implement a Binary Search Tree. Yourprogram must allow the user to perform the following tasks:
◦ Accept values from the user to insert into the binary searchtree
▪ The first node entered by the user becomes the root node ◦Allow the user to delete nodes from the binary search tree
◦ Allow the user to search for a node within the binary searchtree:
▪ If the search key is found, it returns all the nodesvisited(path traversed) to reach the search key.
▪ If search key is not found, returns the path traversed tolocate the search key and indicates a failed search.
Q2:
Write a C++ program to sort an list of n numbers innon-decreasing order using the QuickSort algorithm
◦ Allow the user to provide n values to be sorted.
◦ Use a left-most element of the array as the pivot
◦ Display the sorted list.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply