You are on page 1of 12

adplus-dvertising

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

computer science objective questions for competitive exams

mcqs in computer science pdf free download

Toggle navigation

HOME / ALL CATEGORIES / DATA STRUCTURES AND ALGORITHMS / SORTING AND SEARCHING /

1.

What is not true about insertion sort?

a.

Exhibits the worst case performance when the initial array is sorted in reverse order.

b.

Worst case and average case performance is Ο(n2)

c.

Can be compared to the way a card player arranges his card from a card deck.

d.

None of the above.

Answer: (d).

None of the above.

2.

Which of the following has search efficiency of Ο(1) −


a.

Tree

b.

Heap

c.

Hash Table

d.

Linked-List

Answer: (c).

Hash Table

3.

Which of the following algorithm is not stable?

a.

Bubble Sort

b.

Quick Sort

c.

Merge Sort

d.

Insertion Sort

Answer: (b).

Quick Sort
4.

Which of the below mentioned sorting algorithms are not stable?

a.

Selection Sort

b.

Bubble Sort

c.

Merge Sort

d.

Insertion Sort

Answer: (a).

Selection Sort

5.

A pivot element to partition unsorted list is used in

a.

Merge Sort

b.

Quick Sort

c.

Insertion Sort

d.

Selection Sort
Answer: (b).

Quick Sort

6.

Which of the following algorithm does not divide the list −

a.

linear search

b.

binary search

c.

merge sort

d.

quick sort

Answer: (a).

linear search

7.

Time required to merge two sorted lists of size m and n, is

a.

Ο(m | n)

b.

Ο(m + n)

c.

Ο(m log n)

d.

Ο(n log m)
Answer: (b).

Ο(m + n)

8.

Quick sort algorithm is an example of

a.

Greedy approach

b.

Improved binary search

c.

Dynamic Programming

d.

Divide and conquer

Answer: (d).

Divide and conquer

9.

Quick sort running time depends on the selection of

a.

size of array

b.

pivot element

c.

sequence of values
d.

none of the above

Answer: (b).

pivot element

10.

Which one of the below is not divide and conquer approach?

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.

All of the above

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.

An adaptive sorting algorithm −

a.

adapts to new computers.

b.

takes advantage of already sorted elements.

c.

takes input which is already sorted.

d.

none of the above.

Answer: (b).

takes advantage of already sorted elements.

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.

The worst case complexity of binary search matches with −

a.

interpolation search

b.

linear search

c.

merge sort

d.

none of the above

Answer: (b).

linear search

17.

The number of comparisons done by sequential search is ………………


a.

(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.

Binary Tree search

Answer: (a).

Linear search
19.

State True or False.

i) Binary search is used for searching in a sorted array.

ii) The time complexity of binary search is O(logn).

a.

True, False

b.

False, True

c.

False, False

d.

True, True

Answer: (d).

True, True

20.

Which of the following is not the internal sort?

a.

Insertion Sort

b.

Bubble Sort

c.

Merge Sort
d.

Heap Sort

Answer: (c).

Merge Sort

You might also like