/* */ Click to Join Live Class with Shankar sir Call 9798158723

# Data Structure MCQ - Linked List

Q1.Which of the following information is stored in a doubly-linked list’s nodes?
1. Value of node
3. Address of the previous node
4. All of the above

Explanations : Explanation: A doubly linked list stores information about the value, and addresses of previous and next nodes.
Q2. A linear collection of data elements where the linear node is given by means of pointer is called?
1. Node list
3. Primitive list
4. Unordered list

Explanations :In Linked list each node has its own data and the address of next node. These nodes are linked by using pointers. Node list is an object that consists of a list of all nodes in a document with in a particular selected set of nodes.
Q3.In linked list each node contains a minimum of two fields. One field is data field to store the data second field is?
1. Pointer to character
2. Pointer to integer
3. Node
4. Pointer to node

Explanations :Each node in a linked list contains data and a pointer (reference) to the next node. Second field contains pointer to node.
Q4.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?
1. O(1)
2. O(n)
3. θ(1)
4. θ(n)

Explanations :In case of a linked list having n elements, we need to travel through every node of the list to add the element at the end of the list. Thus asymptotic time complexity is θ(n).
Q5.The concatenation of two lists can be performed in O(1) time. Which of the following variation of the linked list can be used?
4. Array implementation of list

Explanations :We can easily concatenate two lists in O (1) time using singly or doubly linked list, provided that we have a pointer to the last node at least one of the lists. But in case of circular doubly linked lists, we will break the link in both the lists and hook them together. Thus circular doubly linked list concatenates two lists in O (1) time.
Q6.Linked lists are not suitable for the implementation of ___________
1. Binary search
2. Insertion sort
4. Polynomial manipulation

Explanations :It cannot be implemented using linked lists.
Q7. Linked list data structure offers considerable saving in _____________
1. Space Utilization and Computational Time
2. Computational Time
3. Space Utilization
4. Speed Utilization

Explanations :Linked lists saves both space and time.
Q8.Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
1. Insertion Sort
2. Quick Sort
3. Merge Sort
4. Heap Sort

Explanations :Both Merge sort and Insertion sort can be used for linked lists. The slow random-access performance of a linked list makes other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible. Since worst case time complexity of Merge Sort is O(nLogn) and Insertion sort is O(n2), merge sort is preferred.
Q9.What is the output of following function for start pointing to first node of following linked list?
```1->2->3->4->5->6
void fun(struct node* start)
{
if(start == NULL)
return;
printf("%d  ", start->data);
if(start->next != NULL )
fun(start->next->next);
printf("%d  ", start->data);
}```
1. 1 4 6 6 4 1
2. 1 3 5 1 3 5
3. 1 3 5 5 3 1
4. 1 2 3 5