• Home
  • Textbooks
  • Data Structures Using C
  • Searching and Sorting Techniques

Data Structures Using C

Amol M. Jagtap, Ajit S. Mali

Chapter 7

Searching and Sorting Techniques - all with Video Answers

Educators


Chapter Questions

Problem 1

What is the best case time complexity for insertion sort to sort an array of n elements?
A. $\boldsymbol{\Omega}$ (n)
B. $\Omega(n \log n)$
C. $\Omega\left(n^2\right)$
D. $\Omega\left(n \log n^2\right)$

Check back soon!

Problem 3

If the number of elements to be sorted is very less, then $\qquad$ sorting can be efficient.
A. Heap sort
B. Quick sort
C. Merge sort
D. Selection sort

Check back soon!

Problem 4

Which sorting algorithm is of priority queue sorting technique?
A. Quick sort
B. Heap sort
C. Insertion sort
D. Selection sort

Check back soon!

Problem 5

Sorting is also known as a partition and exchange type of sort.
A. Quick sort
B. Heap sort
C. Insertion sort
D. Selection sort

Check back soon!

Problem 6

Which of the following sorting algorithm is based on the divide-and-conquer technique?
A. Bubble sort
B. Selection sort
C. Merge sort
D. Insertion sort

Check back soon!

Problem 7

What is an external sorting algorithm?
A. Algorithm that uses hard disk while sorting the elements.
B. Algorithm that uses main memory or primary memory during the sorting of the elements.
C. Algorithm that involves interchanging of elements
D. None of the above

Check back soon!

Problem 8

The time complexity analysis of the heap sort in the worst-case scenario is
A. $\mathrm{O}(\mathrm{n} 2 \log \mathrm{n})$
B. $O(\log n)$
C. $O(\mathbf{n} \log \mathbf{n})$
D. $\mathrm{O}\left(\mathrm{n}^2 \log \mathrm{n}^2\right)$

Check back soon!

Problem 9

. If the given input array elements are almost sorted in this scenario, which of the following internal sorting algorithm gives the optimum performance efficiency?
A. Selection sort
B. Bubble sort
C. Heap sort
D. Insertion sort

Check back soon!

Problem 10

What is special algorithm design paradigm is used in the quick sort and merge sort algorithm?
A. Greedy method paradigm
B. Backtracking paradigm
C. Divide-and-conquer paradigm
D. Dynamic programming paradigm

Check back soon!

Problem 11

What is the complexity of the search time of the hashing search method?
A. O (n2)
B. O (logn)
C. O (nlogn)
D. $O$ (1)

Check back soon!

Problem 12

Which of the following is not the technique to avoid collision in hashing?
A. Linear probing
B. Chaining with replacement
C. Chaining without replacement
D. Dynamic programming

Check back soon!

Problem 13

In the chaining technique in hashing, which of the following data structure is most suitable?
A. Singly linear linked list
B. Doubly linked list
C. Tree
D. Graph

Check back soon!

Problem 14

What is the worst-case time complexity of linear search and binary search, respectively?
A. $\mathrm{O}(\mathrm{n} \log 2 \mathrm{n}), \mathrm{O}(\log 2 \mathrm{n})$
B. $\mathrm{O}(\log 2 \mathrm{n}), \mathrm{O}(\mathrm{n})$
C. $\mathrm{O}(\mathrm{n}), \mathrm{O}(\log 2 \mathrm{n})$
D. $O(1), O(n)$

Check back soon!

Problem 15

The case in which a hash key other than the desired one is kept at the identified location is called as?
A. Open hashing
B. Closed hashing
C. Chaining
D. Collision

Check back soon!

Problem 16

Which of the following data structure is used in hash tables?
A. Queue
B. Doubly linked list
C. Stack
D. Array

Check back soon!

Problem 17

What is the time complexity of searching, deleting and inserting into direct addressing in hashing?
A. $\mathrm{O}(1), \mathrm{O}(\mathrm{n}), \mathrm{O}(1)$
B. $\mathrm{O}(\mathrm{n}), \mathrm{O}(\mathrm{n}), \mathrm{O}(1)$
C. $\mathrm{O}(1), \mathrm{O}(1), \mathrm{O}(1)$
D. $\mathrm{O}(1), \mathrm{O}(\mathrm{n}), \mathrm{O}(\mathrm{n} 2)$

Check back soon!

Problem 18

Which of the following sorting technique is called non-linear sorting?
A. Heap sort
B. Bubble sort
C. Insertion sort
D. Quick sort

Check back soon!

Problem 19

Which of the following is not an example of a closed hashing or open addressing method?
A. Linear probing
B. Quadratic probing
C. Double hashing
D. Chaining

Check back soon!

Problem 20

What is the quickest search method among the following in the worst case?
A. Linear searching
B. Binary searching
C. Hashing
D. Sequential search

Check back soon!

Problem 21

Which of the following is an example of an open hashing or closed addressing method?
A. Linear probing
B. Quadratic probing
C. Double hashing
D. Use of buckets

Check back soon!

Problem 22

What is the space complexity of quick sort and merge sort algorithm?
A. $O(n \log 2 n), O(\log 2 n)$
B. $O(\log 2 n), O(n)$
C. $O(n), O(\log 2 n)$
D. $\mathrm{O}(1), \mathrm{O}(\mathrm{n})$

Check back soon!