Professional Documents
Culture Documents
[ ]
A. Item is somewhere in the middle of the array B. Item is not in the array at all
C. Item is the last element in the array D. Item is the last element in the array or
item is not there at all
E. None of these
2) If you can sort small amount of records then which sort is efficient? [ ]
A. Merge B. Heap C. Selection D. Insertion E) Bubble
3) The complexity of sorting algorithm measures the ...... for function (). [ ]
A. Average Time B) Running Time C. average-case complexity
D. case-complexity E) None of These
10) The run time complexity of Insertion sort algorithm in worst case. [ ]
A. O(n) B. O(log n) C. O(n2) D. O(n log n) E. None of these
11) The run time complexity of Insertion sort algorithm in Best case. [ ]
2
A. O(n) B. O(log n) C. O(n ) D. O(n log n) E. None of these
14) The run time complexity of Quick sort algorithm in Best case scenario [ ]
A. O(n) B. O(log n) C. O(n2) D. O(n log n) E. None of these.
16. ......order is the best possible for array sorting algorithm which sorts n item.[ ]
A. O (n2) B. O (n log n) C. O (n + log n) D. O (log n) E. None
17. The time factor when determining the efficiency of algorithm is measured by [ ]
A. Counting microseconds B. Counting the number of key operations
C. Counting the kilobytes of algorithm D. counting the number of statements
E. None of these.
21) Which of the following sorting algorithm is of divide and conquer type? [ ]
A. Bubble sort B. Insertion sort C. Quick sort D. Merge sort
E.C and D
24) The operation that combines the element is of A and B in a single sorted list C with n=r
+ s element is called.... [ ]
A. Inserting B. Mixing C. Merging D. Sharing E. None of these
3) if no of records and key is also long , then ...... sorting can be efficient. [ ]
A. Merge B. Heap C. Insertion D. Selection E. Quick
4). if no of records are long and key is short , then ...... sorting can be efficient. [ ]
A. Merge B. Heap C. Insertion D. Selection E. none
5. The function used to modify the way of sorting the keys of records is called ...[ ]
A. Indexing function B. Hash Function C. Addressing function
D. The Entire above E. None of the above
12.Chaining Means? [ ]
A Hash table is implemented as an arrays
B. Hash table is implemented as an array of linked lists
C. Hash table is implemented as an array of Trees
C. Hash table is implemented as an array of Graphs
D. None of these
16. A ----- is binary Tree has a every leaf on the same level, and every non leaf node have
two children. [ ]
A. Perfect Binary Tree B. Completed Binary tree C. Tree
D. Both a and B E. None
17. A ------binary tree is a binary tree, which is completely filled, with the possible exception
of the bottom level, which is filled from left to right. [ ]
A. Perfect Binary Tree B. Completed Binary tree C. Heap Tree
D. Both a and B E. None
18. A -------- binary tree in which the value of each node is greater than the values of
its leaves. [ ]
A. Perfect Binary Tree B. Completed Binary tree C. Heap Tree
D. Both a and B E. None
19. Here A is Array of Elements and i is the index of an Array than MAX_HEAP
PROPERTY Satisfies ----- Condition . [ ]
A .A[PARENT (i)] > A[i] B. A[PARENT (i)] < A[i]
C. A[PARENT (i)] == A[i] D. A[PARENT (i)] ≥ A[i] E. None of These
20. Here A is Array of Elements and i is the index of an Array than MAX_HEAP
PROPERTY Satisfies ----- Condition . [ ]
A .A[PARENT (i)] > A[i] B. A[PARENT (i)] < A[i]
C. A[PARENT (i)] == A[i] D. A[PARENT (i)] ≥ A[i] E. None of These
21. If node A[k] has children its left child is A [2*k+1] and right child is A [2*k+2].
Which Algorithm Satisfies the above Condition? [ ]
A. Binary Sort B. Heap Sort C. Insertion Sort D. A &B E. None
24. We can solve collisions using many strategies, like Open Addressing, it contains---
Following Techniques [ ]
A. Simply you can find the free Index in Liner Way from I th Value.
B. Simply you can find the free Index in Liner Way from 0 th Value.
C .Simply you can find the free Index in Liner Way from Size -1th Value.
D. All of the Above
E. None of These
26. ----- Sorts are used only the primary memory during sorting process. [ ]
Here
/*
Your code here.
*/
}
}
/** Precondition: a[low]...a[mid] is sorted &&
* a[mid+1]...a[high] is sorted
* Postcondition: a[low]...a[high] is sorted
*/
private static void merge(int[] a, int low, int mid, int high)
{
/* your code implement here.
*/
}
}
7. Method sort () arranges the elements in x in increasing order using the insertion sort
algorithm.
8. The precondition for method binarySearch is: x is sorted in increasing order. The
method returns the index of key in x. If key is not in x, the method returns (-(insertion
point) – 1) where insertion point is the index at which key would be inserted in x to
maintain x in sorted order.
Complete method binarySearch below. You must declare and write a recursive helper
method with an appropriate header.
9. Method sort arranges the elements in x in increasing order using the selection sort
algorithm.
Complete method sort below. You may also declare and implement a swap method with
the header of your choice.