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 binary search) Implement the following method using binary search. public static <E extends Comparable<E>> int binarySearch(E[] list, E key)
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
160
(Maximum element in a two-dimensional array) Write a generic method that returns the maximum element in a two-dimensional array
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
210
(Maximum element in an array) Implement the following method that returns the maximum element in an array. public static <E extends Comparable<E>> E max(E[] list)
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
213
(Generic linear search) Implement the following generic method for linear search. public static <E extends Comparable<E>> int linearSearch(E[] list, E key)
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
164
(Distinct elements in ArrayList) Write the following method that returns a new ArrayList. The new list contains the non-duplicate elements from the original list. public static <E> ArrayList<E> removeDuplicates(ArrayList<E> list)
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
247
(Implement GenericStack using inheritance) In Listing 19.1, GenericStack is implemented using composition. Define a new stack class that extends ArrayList. Draw the UML diagram for the classes and then implement GenericStack. Write a test program that prompts the user to enter five strings and disp
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
279
(Revising Listing 19.1) Revise the GenericStack class in Listing 19.1 to implement it using an array rather than an ArrayList. You should check the array size before adding a new element to the stack. If the array is full, create a new array that doubles the current array size and copy the element
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
317
(Dragging the tree) Revise Programming Exercise 18.38 to move the tree to where the mouse is dragged
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
0
147
(Recursive tree) Write a program to display a recursive tree as shown in Figure 18.20
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
0
198
(Hilbert curve) The Hilbert curve, first described by German mathematician David Hilbert in 1891, is a space-filling curve that visits every point in a square grid with a size of 2 * 2, 4 * 4, 8 * 8, 16 * 16, or any other power of 2. Write a program that displays a Hilbert curve for the specified
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
0
258
(Sierpinski triangle) Write a program that lets the user to enter the order and display the filled Sierpinski triangles as shown in Figure 18.18
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
1
198
(H-tree fractal) An H-tree (introduced at the beginning of this chapter in Figure 18.1) is a fractal defined as follows:
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
0
245
(Game: Eight Queens) The Eight Queens problem is to find a solution to place a queen in each row on a chessboard such that no two queens can attack each other. Write a program to solve the Eight Queens problem using recursion and display the result as shown in Figure 18.17
Java programming
2022-06-29
Answers
30
Question
40
Followers
30
0
0
294
Total:
705
Previous
43
44
45
46
47
Next
Go