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

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. Consider the following definition in c programming language

struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;

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. A variant of linked list in which last node of the list points to the first node of the list is?

  • (A) singly linked list
  • (B) doubly linked list
  • (C) circular linked list
  • (D) multiply linked list

A

Admin • 833.24K Points
Coach

Q. In doubly linked lists, traversal can be performed?

  • (A) only in forward direction
  • (B) only in reverse direction
  • (C) in both directions
  • (D) none

A

Admin • 833.24K Points
Coach

Q. What kind of linked list is best to answer question like “What is the item at position n?”

  • (A) singly linked list
  • (B) doubly linked list
  • (C) circular linked list
  • (D) array implementation of linked list

A

Admin • 833.24K Points
Coach

Q. A variation of linked list is circular linked list, in which the last node in the list points to first node of the list. One problem with this type of list is?

  • (A) it waste memory space since the pointer head already points to the first node and thus the list node does not need to point to the first node.
  • (B) it is not possible to add a node at the end of the list.
  • (C) it is difficult to traverse the list as the pointer of the last node is now not null
  • (D) all of above

A

Admin • 833.24K Points
Coach

Q. A variant of the linked list in which none of the node contains NULL pointer is?

  • (A) singly linked list
  • (B) doubly linked list
  • (C) circular linked list
  • (D) none

A

Admin • 833.24K Points
Coach

Q. In circular linked list, insertion of node requires modification of?

  • (A) one pointer
  • (B) two pointer
  • (C) three pointer
  • (D) none

A

Admin • 833.24K Points
Coach

Q. Which of the following statements about linked list data structure is/are TRUE?

  • (A) addition and deletion of an item to/ from the linked list require modification of the existing pointers
  • (B) the linked list pointers do not provide an efficient way to search an item in the linked list
  • (C) linked list pointers always maintain the list in ascending order
  • (D) the linked list data structure provides an efficient way to find kth element in the list

A

Admin • 833.24K Points
Coach

Q. Linked lists are not suitable to for the implementation of?

  • (A) insertion sort
  • (B) radix sort
  • (C) polynomial manipulation
  • (D) binary search

A

Admin • 833.24K Points
Coach

Q. In worst case, the number of comparison need to search a singly linked list of length n for a given element is

  • (A) log n
  • (B) n/2
  • (C) log2n-1
  • (D) n

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