Q: 1 Which of the following statements is not true about the doubly linked list?
We can traverse in both the directions.
It requires extra space.
Implementation of doubly linked list is easier than the singly linked list.
More than one of the above
[ Option C ]
A doubly linked list is a linked list where each node contains three parts:
We can traverse in both the directions. This is true. Because each node has a prev pointer, we can move forward and backward.
It requires extra space. This is true. Every node stores an additional pointer (prev), so space required is more than a singly linked list.
Implementation of doubly linked list is easier than the singly linked list. This statement is not true. A doubly linked list is more difficult to implement because you must maintain both next and prev pointers during insertion and deletion. Singly linked list is simpler.
Q: 2 What does the following function do for a given Linked List with first node as start?
void myFun(struct node* start)
{
if(start==NULL)
return;
myFun(start->link);
printf("%d ", start->info);
}
Prints all nodes of linked list in reverse order.
Prints alternate nodes of Linked List.
Prints alternate nodes in reverse order.
Prints all nodes of linked list.
[ Option A ]
The given function uses recursion to traverse the linked list. When myFun(start) is called, it first checks whether start is NULL. If not, it makes a recursive call on start->link, moving forward to the next node. This continues until the function reaches the last node of the linked list.
Only after all recursive calls return, the printf statement is executed. As a result, the data of the last node is printed first, followed by the second last, and so on, until the first node is printed at the end. Thus, all nodes are printed, but in reverse order.
Q: 3 A circularly linked list is used to represent a Queue. A single variable P is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time?

Front Node
Rear Node
Not possible with a single pointer
Node next to front
[ Option B ]
When a queue is implemented using a circularly linked list and only one pointer P is used, that pointer should point to the rear (last) node of the queue. In a circular linked list, the next pointer of the rear node points to the front node.
Q: 4 What is the output of following function for start pointing to first node of following linked list?
1->2->3->4->5->6
void myFun(struct node* start)
{
if(start==NULL)
return;
printf("%d ", start->info);
if(start->link!=NULL)
myFun(start->link->link);
printf("%d ", start->info);
}
1 2 3 5
1 3 5 1 3 5
1 4 6 6 4 1
1 3 5 5 3 1
[ Option D ]
Q: 5 What is the time complexity of inserting an element at the beginning of a linked list?
O(n)
O(log n)
O (n log n)
O(1)
[ Option D ]
In a linked list, each node contains data (info) and a pointer to the next node (link). When inserting a new element at the beginning of the list, we simply create a new node, set its link to point to the current first node, and then update the head (start) pointer to this new node.
These operations take a constant amount of time because there is no need to traverse the list or move any existing elements. Therefore, the time complexity of inserting an element at the beginning of a linked list is O(1), which means it executes in constant time regardless of the size of the list.
Q: 6 A linked list (without header node) contains 3 nodes. The nodes are self-referential structures having a node pointer (name Link) apart from the information. Let START is pointer to the first node and END is pointer to the last node of the linked list. If the following C statements are executed in order, what will happen?
(X is a pointer of node type)
X=START->Link;
START->Link = X->Link;
free(X);
First Node will be deleted
Last Node will be deleted
START pointer will become NULL
Middle Node will be deleted
[ Option D ]
In this,
Q: 7 Which of the following is true about linked list implementation of stack?
In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.
In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.
Both (A) and (B)
None of the above
[ Option D ]
In a linked list implementation of a stack, both push and pop operations must be performed at the same end of the list in order to follow the LIFO (Last In, First Out) principle.

Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.