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

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. One difference between a queue and a stack is:

  • (A) queues require dynamic memory, but stacks do not.
  • (B) stacks require dynamic memory, but queues do not
  • (C) queues use two ends of the structure; stacks use only one.
  • (D) stacks use two ends of the structure, queues use only one.

A

Admin • 833.24K Points
Coach

Q. Which of the following formulas in big-O notation best represent the expression n²+35n+6?

  • (A) o(n³)
  • (B) o(n²)
  • (C) o(n)
  • (D) o(42)

A

Admin • 833.24K Points
Coach

Q. What term is used to describe an O(n) algorithm

  • (A) constant
  • (B) linear
  • (C) logarithmic
  • (D) quadratic

A

Admin • 833.24K Points
Coach

Q. How many times the program will print "Amrutvahini" ? #include<stdio.h>
int main()
{
printf("Amrutvahini");
main();
return 0;
}

  • (A) infinite times
  • (B) 32767 times
  • (C) 65535 times
  • (D) till stack overflows

A

Admin • 833.24K Points
Coach

Q. What will be the output of the program? #include<stdio.h>
int i;
int fun();

int main()
{
while(i)
{
fun();
main();
}
printf("Hello
");
return 0;
}
int fun()
{
printf("Hi");
}

  • (A) hello
  • (B) hi hello
  • (C) no output
  • (D) infinite loop

A

Admin • 833.24K Points
Coach

Q. In a linked list, the pointer of the last node contains a special value, called the ______ pointer.

  • (A) null
  • (B) zero
  • (C) link
  • (D) next pointer

A

Admin • 833.24K Points
Coach

Q. The second part of the node, is called _______ field, and contains the address of the next node in the list.

  • (A) pointer
  • (B) field
  • (C) node
  • (D) link

A

Admin • 833.24K Points
Coach

Q. The link list also contains a list pointer variable called start or ________.

  • (A) name
  • (B) field
  • (C) node
  • (D) link

A

Admin • 833.24K Points
Coach

Q. A ________ linked list is a linked list structure in which each node has a pointer to both its successor and predecessor.

  • (A) circularly
  • (B) doubly
  • (C) linear
  • (D) sequential

A

Admin • 833.24K Points
Coach

Q. _______ list is a special list that is maintained, which consists of unused memory cells.

  • (A) linear
  • (B) doubly linked
  • (C) circularly linked
  • (D) free storage

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