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

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

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!