Java Q1 Bst 1 Write Method Takes Array Parameter Contains Elements Bst Traversed Preorder Q37260240

java

Q1.    BST:
1. Write a method that takes an array A, as parameter (A containsthe elements of a BST traversed in preorder) and returns thecorresponding BST.
2. Write a method to list the nodes on the path from the root to agiven node in the BST.
3. Write a recursive method to check if two BSTs are same.
4. Write a non-recursive method to check if two BSTs aresame.
5. Write a method to count the number of nodes in BST with a singlechild.
6. Write the main program to test your methods.
Q2. Design and implement a program to read information about roadsconnecting a

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.