Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Data Structure questions 1. Explain why a binary search implementation of a

ID: 3685465 • Letter: J

Question

Java Data Structure questions

1. Explain why a binary search implementation of a sorted chain is impractical.

2. Given the following data set: 3 7 9 4 2 5, which sorting method would be recoomended?

A. binary search on an sorted array.

B. Iterative sequential search on a sorted array.

C. Iterative sequential search on an unsorted array.

D. None of the above.

3. Assume you have an array of unsorted items that allows duplicate entries and that the item you are searching for is present. Using an iterative sequential search on an unsorted array, the loop exists when :

A. It locates the first entry in the array that matches the item being searched for.

B. It locates the last entry in the array that matches the item being searched for.

C. When it reaches the end of the array.

D. None of the above.

4. The best case time efficency of a sequential search on an array is:

A. O(1)

B. O(log n)

C. O(n)

D. O(n^2)

5. The average-case time effiency of a sequential search on an array is:

A. O(1)

B. O(log n)

C. O(n)

D. O(n^2)

6. The worst-case time effiency of a sequential search on an arrray is:

A. O(1)

B. O(log n)

C. O(n)

D. O(n^2)

6. A search on data set that divides the data roughly in half every iteration is called a(n) ____ search.

A. Binary

B. Divided

C. Sequential

D. Sorted

7. In an array of 100 items sorted in ascending order, if you are searching for the the number 165 and the entry at array index[50] has a value of 72, what can we conclude?

A. If the value is in the array, it will found somewhere at indexes [51] through [99]

B. One half of the array can be ignored in the next step.

C. The value will not be found at indexes [0] hrouh[50].

D. All of the above.

Exttra Question: Classes that implement the Comparable interface must define:

A. compareTo

B. equals

C. lessThan

D. notEquals

Explanation / Answer


2. Iterative sequential search on an unsorted array.
3.It locates the last entry in the array that matches the item being searched for.
3.C. O(n)
4. O(n^2)
5. Binary
6. All of the above.
7.A. compareTo

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote