Example HTML page

DS – mcq on Sorting

The following are the objective questions on the topic related to Sorting in data structures using C/C++.

1. Which of the following is not a non comparison sort?

  1. Counting sort
  2. Bucket sort
  3. Radix sort
  4. Shell sort

Answer: D

2. The time complexity of heap sort in worst case is___

  1. O(logn)
  2. O(n)
  3. O(nlogn)
  4. O(n2)

Answer: C

3.In a binary max heap containing n numbers, the smallest element can be found in time_.

  1. θ (n)
  2. θ (logn)
  3. θ (loglogn)
  4. θ (1)

Answer:A

4.The running time for creating a heap of size n is

  1. O (n)
  2. O (log n)
  3. O (n log n)
  4. O (n2)

Answer: C

5.Finding the location of a given item in a collection of items is called ……

  1. Discovering
  2. Finding
  3. Searching
  4. Mining

Answer:C

6.Which of the following is an external sorting?

  1. Insertion Sort
  2. Bubble Sort
  3. Merge Sort
  4. Tree Sort

Answer: C

7.The function used to modify the way of sorting the keys of records is called ……..

  1. Indexing function
  2. Hash function
  3. Addressing function
  4. All of the above

Answer: B

8.The complexity of bubble sort algorithm is …..

  1. O(n)
  2. O(logn)
  3. O(n2)
  4. O(n logn)

Answer:C

9.Bubble sort sometimes referred to as _____________.

  1. binding sort.
  2. sinking sort.
  3. skip sort.
  4. none of these.

Answer: B

10.The worst complexity of bubble sort is ________.

  1. O(n2).
  2. O(nlogn)
  3. O(n)
  4. O(n+1)

Answer: A

11.The bubble sort algorithm compares each pair of adjacent___________ and swaps them if they are in wrong order.

  1. items
  2. nodes
  3. links
  4. none

Answer: A

12.The best complexity of bubble sort is _____

  1. O(n2)
  2. O(nlogn)
  3. O(n)
  4. O(n+1)

Answer: C

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest