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

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. You are asked to sort 15 randomly generated numbers. You should prefer

  • (A) bubble sort
  • (B) selection sort
  • (C) insertion sort
  • (D) merge sort

A

Admin • 833.24K Points
Coach

Q. What is the number of swaps required to sort n elements using selection sort, in the worst case?

  • (A) Θ(n)
  • (B) Θ(n log n)
  • (C) Θ(n2)
  • (D) Θ(n2 log n)

A

Admin • 833.24K Points
Coach

Q. The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is

  • (A) 6
  • (B) 5
  • (C) 7
  • (D) 8

A

Admin • 833.24K Points
Coach

Q. The smallest element of an array’s index is called its

  • (A) lower bound
  • (B) upper bound
  • (C) range
  • (D) extraction

A

Admin • 833.24K Points
Coach

Q. Which of the following sorting methods would be most suitable for sorting a list which is almost sorted

  • (A) bubble sort
  • (B) selection sort
  • (C) insertion sort
  • (D) merge sort

A

Admin • 833.24K Points
Coach

Q. Select the set of instructions to insert a node pointed by q after a node pointed by p

  • (A) q->next=p->next; p->next=q;
  • (B) p->next=q; q->next=p->next
  • (C) both (a)and(b)
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. select the set of operations to insert a node pointed by q at the beginning of the linked list

  • (A) q->next=head; head=q;
  • (B) head=q;q ->next=head;
  • (C) both (a)and(b)
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. Select the set of operations to delete the first node from a linked list

  • (A) p=head;head=head->next;free(p);
  • (B) free(head)
  • (C) head=head->next;p=head;free(p)
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. Select the correct looping condition for positioning apointer p on the second last in a linked list.Assume p=head,initially.

  • (A) p->next->next!=null
  • (B) p->next=null
  • (C) p!=null
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. If address of the 8th element in a linked list of integers is1022,then address of the 9th element is

  • (A) 1024
  • (B) 1026
  • (C) 1023
  • (D) unknown

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