Question: Lab Practice Lab Task: Use the below code and fill it where appropriate to prompt the user to insert numbers into tree, display tree nodes,

Lab Practice

Lab Practice Lab Task: Use the below code and fill it where

appropriate to prompt the user to insert numbers into tree, display tree

nodes, search the tree nodes for a number, and to delete a

node from tree. The program must show this message when it starts:

Enter first letter of show, insert, find, delete, or traverse: Note: traversehas three types. *please write it by computer typing so it will

be easy to copy it. the original document : https://drive.google.com/file/d/1J_rxQbWn1sKsiHhRQvC6mvAkFfmD71DF/view?usp=sharing class Nodepublic int iData; public double dData; public Node leftchild; public Node rightchild

// data item (key) // data item /I this node's left child

Lab Task:

Use the below code and fill it where appropriate to prompt the user to insert numbers into tree, display tree nodes, search the tree nodes for a number, and to delete a node from tree. The program must show this message when it starts:

Enter first letter of show, insert, find, delete, or traverse:

Note: traverse has three types.

*please write it by computer typing so it will be easy to copy it.

// this node's right child ic void displayNode) 1I display System.out.print'); System-out.

print ( iData); System.out.print(", "); System.out.print(dData) System.out.print("] "); /I end class Node

import java io. import java.util.*; class Tree private Node root; /I first

the original document : https://drive.google.com/file/d/1J_rxQbWn1sKsiHhRQvC6mvAkFfmD71DF/view?usp=sharing

class Node public int iData; public double dData; public Node leftchild; public Node rightchild // data item (key) // data item /I this node's left child // this node's right child ic void displayNode) 1I display System.out.print'); System-out. print ( iData); System.out.print(", "); System.out.print(dData) System.out.print("] "); /I end class Node import java io. import java.util.*; class Tree private Node root; /I first node of tree public Tree) /I constructor // no nodes in tree yet root null; public Node find(int key) // find node with given key /I (assumes non-empty tree) class Node public int iData; public double dData; public Node leftchild; public Node rightchild // data item (key) // data item /I this node's left child // this node's right child ic void displayNode) 1I display System.out.print'); System-out. print ( iData); System.out.print(", "); System.out.print(dData) System.out.print("] "); /I end class Node import java io. import java.util.*; class Tree private Node root; /I first node of tree public Tree) /I constructor // no nodes in tree yet root null; public Node find(int key) // find node with given key /I (assumes non-empty tree)

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!