Data Structure Questions and Answers-Uniform Binary Search

DOWNLOAD FREE PDF <<CLICK HERE>>

Data Structure Questions and Answers-Uniform Binary Search

Congratulations - you have completed Data Structure Questions and Answers-Uniform Binary Search.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
When is the uniform binary search an optimization over the usual binary search?
A
A table lookup is generally faster than an addition and a shift
B
Many searches will be performed on the same array
C
Many searches will be performed on several arrays of the same length
D
All of the mentioned

CLICK HERE FOR ALL SUBJECTS MCQ

Question 1 Explanation: 
Suitable for architectures such as Knuth's MIX and MMIX and this algorithm was proposed by Donald Knuth.

Question 2 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Which of the following is a suitable lookup table that can be used in the uniform binary search?(N is the number of elements in the array and the delta array is global)
A

public static void make....delta(int N) { int power = 1; int i = 0; do { int half = power; power <<= 1; delta[i
public static void make....delta(int N) { int power = 0; int i = 0; do { int half = power; power <<= 1; delta[i
public static void make....delta(int N) { int power = 1; int i = 0; do { int half = power; power >>= 1; delta[i
D

public static void make....delta(int N) { int power = 1; int i = 0; do { int half = power; power <<= 1; delta[iCLICK HERE FOR ALL SUBJECTS MCQ
Question 2 Explanation: 
This provides a single lookup index and the values are dependent on the the number of elements(N) in the array.

Question 3 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Given delta[4] is a global array and number of elements in the sorted array is 10, what are the values in the delta array?
A
4, 3, 1, 0
B
5, 3, 1, 0
C
4, 2, 1, 1
D
5, 2, 1, 1

CLICK HERE FOR ALL SUBJECTS MCQ

Question 3 Explanation: 
Trace with respect to the make....delta function, always note that the last element is always 0.

Question 4 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Choose the appropriate code snippet that performs uniform binary search.
A

public static int unisearch(int key) { int i = delta[0] - 1; int j = 0; while (true) { if 
B

public static int unisearch(int key) { int i = delta[1] - 1; int j = 0; while (true) 
C
public static int unisearch(int key) { int i = delta[0] - 1; int j = 0; while (true) { if (
D
None of the mentioned

CLICK HERE FOR ALL SUBJECTS MCQ

Question 4 Explanation: 
Unlike the usual binary search which a low, high and a mid variable and every time comparing the key with the mid value, the comparing index is obtained from the lookup delta table, choosing the left or right side of the array is same as with the normal binary search.

Question 5 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
What is the time complexity of uniform binary search?
A
O(nlogn)
B
O(logn)
C
O(n)
D
O(n2)

CLICK HERE FOR ALL SUBJECTS MCQ

Question 5 Explanation: 
With every iteration we are dividing the array into two parts(though not equal halves), the complexity remains same as the normal binary search.

Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.

DOWNLOAD FREE PDF <<CLICK HERE>>