Question: IMPORTANT NOTE: For the Question you need to provide a BST java file containing the source code. The java code should start with a commented

IMPORTANT NOTE: For the Question you need to provide a BST java file containing the source code. The java code should start with a commented block explaining how to compile and run your implementation.

IMPORTANT NOTE: For the Question you need to provide a BST java

Consider the following definitions of BSTNode and BST classes: public class BSTNode> I protected T el; protected BSTNode left, right; public BSTNode ) l public BSTNode (T el) I this (el,null,null); public BSTNode (T el, BSTNode lt, BSTNode rt) i this.el - el; left - lt; right -rt; public class BST> t protected BSTNode root = null; ublic BST) Implement the following methods in class BST 1. 2. 3. 4. 5. countRightChildren: to count the number of right children in a BST. getHeight: to find the height of the tree checkBalanced: to check if the tree is perfectly balanced checkBST: to check if the tree is a binary search tree. getDescendentsList: to return the list (ArrayList) of the descendents of a node given as parameter getAncestorsList: to return the list (ArrayList) of the ancestors of a node given as parameter. 6. Consider the following definitions of BSTNode and BST classes: public class BSTNode> I protected T el; protected BSTNode left, right; public BSTNode ) l public BSTNode (T el) I this (el,null,null); public BSTNode (T el, BSTNode lt, BSTNode rt) i this.el - el; left - lt; right -rt; public class BST> t protected BSTNode root = null; ublic BST) Implement the following methods in class BST 1. 2. 3. 4. 5. countRightChildren: to count the number of right children in a BST. getHeight: to find the height of the tree checkBalanced: to check if the tree is perfectly balanced checkBST: to check if the tree is a binary search tree. getDescendentsList: to return the list (ArrayList) of the descendents of a node given as parameter getAncestorsList: to return the list (ArrayList) of the ancestors of a node given as parameter. 6

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!