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
4. Shell sort

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

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

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)

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)

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

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

6.Which of the following is an external sorting?

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

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

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

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

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

9.Bubble sort sometimes referred to as _____________.

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

10.The worst complexity of bubble sort is ________.

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

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

1. items
2. nodes
4. none