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

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. In a circular queue, how do you increment the rear end of the queue?

  • (A) rear++
  • (B) (rear+1) % CAPACITY
  • (C) (rear % CAPACITY)+1
  • (D) rear–

A

Admin • 833.24K Points
Coach

Q. What is the term for inserting into a full queue known as?

  • (A) overflow
  • (B) underflow
  • (C) null pointer exception
  • (D) program won’t be compiled

A

Admin • 833.24K Points
Coach

Q. A full binary tree can be generated using

  • (A) post-order and pre-order traversal
  • (B) pre-order traversal
  • (C) post-order traversal
  • (D) in-order traversal

A

Admin • 833.24K Points
Coach

Q. The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is

  • (A) 3
  • (B) 1
  • (C) 2
  • (D) any number

A

Admin • 833.24K Points
Coach

Q. The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of following is post-order traversal of the tree?

  • (A) L N M O Q P T
  • (B) N M O P O L T
  • (C) L M N O P Q T
  • (D) O P L M N Q T

A

Admin • 833.24K Points
Coach

Q. Find the postorder traversal of the binary tree shown below.

  • (A) P Q R S T U V W X
  • (B) W R S Q P V T U X
  • (C) S W T Q X U V R P
  • (D) none

A

Admin • 833.24K Points
Coach

Q. For the tree below, write the in-order traversal.

  • (A) 6, 2, 5, 7, 11, 2, 5, 9, 4
  • (B) 6, 5, 2, 11, 7, 4, 9, 5, 2
  • (C) 2, 7, 2, 6, 5, 11, 5, 9, 4
  • (D) none

A

Admin • 833.24K Points
Coach

Q. For the tree below, write the level-order traversal.

  • (A) 2, 7, 2, 6, 5, 11, 5, 9, 4
  • (B) 2, 7, 5, 2, 11, 9, 6, 5, 4
  • (C) 2, 5, 11, 6, 7, 4, 9, 5, 2
  • (D) none

A

Admin • 833.24K Points
Coach

Q. What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)

  • (A) O(1)
  • (B) O(nlogd)
  • (C) O(logd)
  • (D) O(d)

A

Admin • 833.24K Points
Coach

Q. What is the time complexity of level order traversal?

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

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