Search Sort MCQ Gate
Search Sort MCQ Gate
computer science objective type questions pdf computer science multiple choice questions with
answers pdf
mcq in computer science pdf multiple choice questions in computer science pdf download computer
science multiple choice questions with answers doc computer science quiz questions with answers pdf
computer basics mcq pdf
Toggle navigation
HOME / ALL CATEGORIES / DATA STRUCTURES AND ALGORITHMS / SORTING AND SEARCHING /
1.
a.
Exhibits the worst case performance when the initial array is sorted in reverse order.
b.
c.
Can be compared to the way a card player arranges his card from a card deck.
d.
Answer: (d).
2.
Tree
b.
Heap
c.
Hash Table
d.
Linked-List
Answer: (c).
Hash Table
3.
a.
Bubble Sort
b.
Quick Sort
c.
Merge Sort
d.
Insertion Sort
Answer: (b).
Quick Sort
4.
a.
Selection Sort
b.
Bubble Sort
c.
Merge Sort
d.
Insertion Sort
Answer: (a).
Selection Sort
5.
a.
Merge Sort
b.
Quick Sort
c.
Insertion Sort
d.
Selection Sort
Answer: (b).
Quick Sort
6.
a.
linear search
b.
binary search
c.
merge sort
d.
quick sort
Answer: (a).
linear search
7.
a.
Ο(m | n)
b.
Ο(m + n)
c.
Ο(m log n)
d.
Ο(n log m)
Answer: (b).
Ο(m + n)
8.
a.
Greedy approach
b.
c.
Dynamic Programming
d.
Answer: (d).
9.
a.
size of array
b.
pivot element
c.
sequence of values
d.
Answer: (b).
pivot element
10.
a.
Insertion Sort
b.
Merge Sort
c.
Shell Sort
d.
Heap Sort
Answer: (b).
Merge Sort
11.
Which of the following searching techniques do not require the data to be in sorted form
a.
Binary Search
b.
Interpolation Search
c.
Linear Search
d.
Answer: (c).
Linear Search
12.
Which of the below given sorting techniques has highest best-case runtime complexity
a.
quick sort
b.
selection sort
c.
insertion sort
d.
bubble sort
Answer: (b).
selection sort
13.
How many swaps are required to sort the given array using bubble sort - { 2, 5, 1, 3, 4} ?
a.
b.
5
c.
d.
Answer: (a).
14.
a.
b.
c.
d.
Answer: (b).
15.
The following sorting algorithms maintain two sub-lists, one sorted and one to be sorted −
a.
Selection Sort
b.
Insertion Sort
c.
Merge Sort
d.
both A & B
Answer: (d).
both A & B
16.
a.
interpolation search
b.
linear search
c.
merge sort
d.
Answer: (b).
linear search
17.
(N/2)+1
b.
(N+1)/2
c.
(N-1)/2
d.
(N+2)/2
Answer: (b).
(N+1)/2
18.
In ……………, search start at the beginning of the list and check every element in the list.
a.
Linear search
b.
Binary search
c.
Hash Search
d.
Answer: (a).
Linear search
19.
a.
True, False
b.
False, True
c.
False, False
d.
True, True
Answer: (d).
True, True
20.
a.
Insertion Sort
b.
Bubble Sort
c.
Merge Sort
d.
Heap Sort
Answer: (c).
Merge Sort
21.
In general, the binary search method needs no more than ……………. comparisons.
a.
[log2n]-1
b.
[logn]+1
c.
[log2n]
d.
[log2n]+1
Answer: (d).
[log2n]+1
22.
a.
b.
c.
Item is the last element in the array
d.
Answer: (d).
23.
a.
b.
c.
d.
When Item is the last element in the array or is not there at all
Answer: (a).
24.
Which of the following is not the required condition for binary search algorithm?
a.
b.
there should be the direct access to the middle element in any sublist
c.
d.
none of above
Answer: (c).
25.
a.
b.
requirement of sorted array is expensive when a lot of insertion and deletions are needed
c.
d.
binary search algorithm is not efficient when the data elements are more than 1000
Answer: (d).
binary search algorithm is not efficient when the data elements are more than 1000
26.
a.
sorted linked list
b.
c.
d.
pointer array
Answer: (a).
27.
If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the expected
number of collisions involving a particular key x is :
a.
less than 1
b.
less than n
c.
less than m
d.
Answer: (a).
less than 1
28.
You have to sort a list L consisting of a sorted list followed by a few “random” elements. Which of the
following sorting methods would be especially suitable for such a task?
a.
Bubble sort
b.
Selection sort
c.
Quick sort
d.
Insertion sort
Answer: (d).
Insertion sort
29.
a.
Binary Search
b.
Linear Search
c.
Tree Search
d.
Hashing
30.
The searching technique that takes O (1) time to find a data is
a.
Linear Search
b.
Binary Search
c.
Hashing
d.
Tree Search
Answer: (c).
Hashing