Data Structure and Algorithms (DSA) MCQs with answers Page - 53

Here, you will find a collection of MCQ questions on Data Structure and Algorithms (DSA). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Which of the following is not an advantage of optimised bubble sort over other sorting techniques in case of sorted elements?

  • (A) It is faster
  • (B) Consumes less memory
  • (C) Detects whether the input is already sorted
  • (D) Consumes less time

A

Admin • 833.24K Points
Coach

Q. The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array?

  • (A) 4
  • (B) 2
  • (C) 1
  • (D) 0

A

Admin • 833.24K Points
Coach

Q. What is the best case efficiency of bubble sort in the improvised version?

  • (A) O(nlogn)
  • (B) O(logn)
  • (C) O(n)
  • (D) O(n2)

A

Admin • 833.24K Points
Coach

Q. The given array is arr = {1,2,4,3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array with improvised version?

  • (A) 4
  • (B) 2
  • (C) 1
  • (D) 0

A

Admin • 833.24K Points
Coach

Q. What is an in-place sorting algorithm?

  • (A) It needs O(1) or O(logn) memory to create auxiliary locations
  • (B) The input is already sorted and in-place
  • (C) It requires additional storage
  • (D) It requires additional space

A

Admin • 833.24K Points
Coach

Q. Which hash function satisfies the condition of simple uniform hashing?

  • (A) h(k) = lowerbound(km)
  • (B) h(k)= upperbound(mk)
  • (C) h(k)= lowerbound(k)
  • (D) h(k)= upperbound(k)

A

Admin • 833.24K Points
Coach

Q. What is the hash function used in the division method?

  • (A) h(k) = k/m
  • (B) h(k) = k mod m
  • (C) h(k) = m/k
  • (D) h(k) = m mod k

A

Admin • 833.24K Points
Coach

Q. What can be the value of m in the division method?

  • (A) Any prime number
  • (B) Any even number
  • (C) 2p – 1
  • (D) 2p

A

Admin • 833.24K Points
Coach

Q. Which scheme provides good performance?

  • (A) open addressing
  • (B) universal hashing
  • (C) hashing by division
  • (D) hashing by multiplication

A

Admin • 833.24K Points
Coach

Q. Using division method, in a given hash table of size 157, the key of value 172 be placed at position

  • (A) 19
  • (B) 72
  • (C) 15
  • (D) 17

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ