Olete.in
Articles
Mock Tests
🧪 Data structure MCQ Quiz Hub
Data Structure Questions and Answers – Singly Linked
Choose a topic to test your knowledge and improve your Data structure skills
1. A linear collection of data elements where the linear node is given by means of pointer is called?
Linked list
Node list
Primitive list
Unordered list
2. Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list ii) Insertion at the end of the linked list iii) Deletion of the front node of the linked list iv) Deletion of the last node of the linked list
I and II
I and III
I, II and III
I, II and IV
3. 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?
O(1)
O(n)
?(n)
?(1)
4. What would be the asymptotic time complexity to insert an element at the front of the linked list (head is known)?
O(1)
O(n)
O(n2)
O(n3)
5. What would be the asymptotic time complexity to find an element in the linked list?
O(1)
O(n)
O(n2)
O(n4)
6. What would be the asymptotic time complexity to insert an element at the second position in the linked list?
O(1)
O(n)
O(n2)
O(n3)
7. The concatenation of two lists can be performed in O(1) time. Which of the following variation of the linked list can be used?
Singly linked list
Doubly linked list
Circular doubly linked list
Array implementation of list
8. 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?
ptr = (NODE*)malloc(sizeof(NODE));
ptr = (NODE*)malloc(NODE);
ptr = (NODE*)malloc(sizeof(NODE*));
ptr = (NODE)malloc(sizeof(NODE));
9. What kind of linked list is best to answer questions like �What is the item at position n?�
Singly linked list
Doubly linked list
Circular linked list
Array implementation of linked list
10. In Linked List implementation, a node carries information regarding ___________
Data
Link
Data and Link
Node
11. Linked list data structure offers considerable saving in _____________
Computational Time
Space Utilization
Space Utilization and Computational Time
Speed Utilization
12. Which of the following points is/are not true about Linked List data structure when it is compared with an array?
Arrays have better cache locality that can make them better in terms of performance
It is easy to insert and delete elements in Linked List
Random access is not allowed in a typical implementation of Linked Lists
Access of elements in linked list takes less time than compared to arrays
13. What does the following function do for a given Linked List with first node as head? void fun1(struct node* head) { if(head == NULL) return; fun1(head->next); printf("%d ", head->data); }
Prints all nodes of linked lists
Prints all nodes of linked list in reverse order
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order
14. In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is?
log 2 n
n?2
log 2 n � 1
n
15. Given pointer to a node X in a singly linked list. Only one pointer is given, pointer to head node is not given, can we delete the node X from given linked list?
Possible if X is not last node
Possible if size of linked list is eve
Possible if size of linked list is odd
Possible if X is not first node
16. You are given pointers to first and last nodes of a singly linked list, which of the following operations are dependent on the length of the linked list?
Delete the first element
Insert a new element as a first element
Delete the last element of the list
Add a new element at the end of the list
17. Which of the following is not a disadvantage to the usage of array?
Fixed size
There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
Insertion based on position
Accessing elements at specified positions
18. What is the time complexity of inserting at the end in dynamic arrays?
O(1)
O(n)
O(logn)
Either O(1) or O(n)
19. What is the time complexity to count the number of elements in the linked list?
O(1)
O(n)
O(logn)
O(n2)
20. What is the space complexity for deleting a linked list?
O(1)
O(n)
Either O(1) or O(n)
O(logn)
21. Which of these is not an application of a linked list?
To implement file systems
For separate chaining in hash-tables
To implement non-binary trees
Random Access of elements
Submit