# Algorithm multiple choice questions part-2

## Algorithm MCQs:-

1. What is a linked list? a) A linear data structure where elements are stored contiguously b) A linear data structure where elements are linked using pointers c) A nonlinear data structure where elements are linked using pointers d) A nonlinear data structure where elements are stored contiguously

Answer: b) A linear data structure where elements are linked using pointers

1. What is the advantage of linked list over arrays? a) Fixed size b) Ease of random access c) Dynamic size d) No extra memory space required

1. What is the drawback of linked list compared to arrays? a) Ease of insertion/deletion b) Fixed size c) Random access is not allowed d) No extra memory space required

Answer: c) Random access is not allowed

1. How is a linked list represented in C? a) As an array b) As a pointer to the last node of the linked list c) As a pointer to the first node of the linked list d) As a binary tree

Answer: c) As a pointer to the first node of the linked list

1. What is the name given to the first node of a linked list? a) Tail b) Root c) Head d) Trunk

1. What is stored in each node of a linked list? a) The position of the next node b) The value of the previous node c) The value of the current node and the position of the next node d) The value of the current node and a pointer to the next node

Answer: d) The value of the current node and a pointer to the next node

1. What is the name given to the pointer that points to the next node in a linked list node? a) Prev b) Next c) Current d) Tail

1. Which of the following operations are supported by linked lists? a) Random access b) Insertion c) Deletion d) All of the above

Answer: d) All of the above

1. What is the memory requirement for each element in a linked list? a) Only the size of the data element b) Only the size of the pointer element c) Both the size of the data element and the size of the pointer element d) None of the above

Answer: c) Both the size of the data element and the size of the pointer element

1. Which of the following data structures is best suited for implementing a stack? a) Linked list b) Array c) Binary tree d) Queue

Pre  ðŸ‘ˆ                                ðŸ‘‰  Next