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

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. The binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree is

  • (A) log2N
  • (B) n-1
  • (C) n
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Each entry in a linked list is a called a_______________.

  • (A) Link.
  • (B) Node.
  • (C) Data Structure.
  • (D) Avail.

A

Admin • 833.24K Points
Coach

Q. What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?

  • (A) O(1)
  • (B) O(n)
  • (C) θ(n)
  • (D) θ(1)

A

Admin • 833.24K Points
Coach

Q. What would be the asymptotic time complexity to insert an element at the front of the linked list (head is known)?

  • (A) O(1)
  • (B) O(n)
  • (C) O(n2)
  • (D) O(n3)

A

Admin • 833.24K Points
Coach

Q. What would be the asymptotic time complexity to find an element in the linked list?

  • (A) O(1)
  • (B) O(n)
  • (C) O(n2)
  • (D) O(n4)

A

Admin • 833.24K Points
Coach

Q. What would be the asymptotic time complexity to insert an element at the second position in the linked list?

  • (A) O(1)
  • (B) O(n)
  • (C) O(n2)
  • (D) O(n3)

A

Admin • 833.24K Points
Coach

Q. Which of the following c code is used to create new node?

  • (A) ptr = (NODE*)malloc(sizeof(NODE));
  • (B) ptr = (NODE*)malloc(NODE);
  • (C) ptr = (NODE*)malloc(sizeof(NODE*));
  • (D) ptr = (NODE)malloc(sizeof(NODE));

A

Admin • 833.24K Points
Coach

Q. Process of inserting an element in stack is called

  • (A) Create
  • (B) Push
  • (C) Evaluation
  • (D) Pop

A

Admin • 833.24K Points
Coach

Q. Process of removing an element from stack is called

  • (A) Create
  • (B) Push
  • (C) Evaluation
  • (D) Pop

A

Admin • 833.24K Points
Coach

Q. In a stack, if a user tries to remove an element from empty stack it is called

  • (A) Underflow
  • (B) Empty collection
  • (C) Overflow
  • (D) Garbage Collection