Discover
Questions library
Collections library
Find online teacher
login
Discover
questions library
Find online teacher
login
Popular searches:
if-else
class-diagram
flowchart
Polymorphism
Home
Questions
Questions
Study lists
Asmaamasry Questions
705 Questions
(Generic BST using Comparator) Revise BST in Listing 25.5, using a generic parameter and a Comparator for comparing objects. Define a new constructor with a Comparator as its argument as follows:
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
197
(Add new buttons in BSTAnimation) Modify Listing 25.9, BSTAnimation.java, to add three new buttons—Show Inorder, Show Preorder, and Show Postorder— to display the result in a label, as shown in Figure 25.24
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
0
120
(Test BST) Design and write a complete test program to test if the BST class in Listing 25.5 meets all requirements
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
0
180
(Display tree) Write a new view class that displays the tree horizontally with the root on the left as shown in Figure 25.23
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
0
159
(Preorder iterator) Add the following method in the BST class that returns an iterator for traversing the elements in a BST in preorder
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
166
(Tree clone and equals) Implement the clone and equals methods in the BST class. Two BST trees are equal if they contain the same elements. The clone method returns an identical copy of a BST
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
182
(Implement bidirectional iterator) The java.util.Iterator interface defines a forward iterator. The Java API also provides the java.util.ListIterator interface that defines a bidirectional iterator. Study ListIterator and define a bidirectional iterator for the BST class
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
0
206
(Find the nonleaves) Add a method in the BST class to return the number of the nonleaves as follows:
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
151
(Find the leaves) Add a method in the BST class to return the number of the leaves as follows:
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
150
(Implement postorder traversal without using recursion) Implement the postorder method in BST using a stack instead of recursion. Write a test program that prompts the user to enter 10 integers, stores them in a BST, and invokes the postorder method to display the elements
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
223
(Implement preorder traversal without using recursion) Implement the preorder method in BST using a stack instead of recursion. Write a test program that prompts the user to enter 10 integers, stores them in a BST, and invokes the preorder method to display the elements
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
275
(Implement inorder traversal without using recursion) Implement the inorder method in BST using a stack instead of recursion. Write a test program that prompts the user to enter 10 integers, stores them in a BST, and invokes the inorder method to display the elements
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
219
(Test full binary tree) A full binary tree is a binary tree with the leaves on the same level. Add a method in the BST class to return true if the tree is a full binary tree. (Hint: The number of nodes in a full binary tree is 2depth - 1.)
Java programming
2022-07-01
Answers
30
Question
40
Followers
30
0
1
156
Total:
705
Previous
34
35
36
37
38
Next
Go