MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In ____ type of linked lists we can traverse in both the directions.
A
Singly linked list
B
Circular linked list
C
One dimensional linked list
D
Doubly linked list
Explanation: 

Detailed explanation-1: -A doubly linked list is a bi-directional linked list. So, you can traverse it in both directions. Unlike singly linked lists, its nodes contain one extra pointer called the previous pointer. This pointer points to the previous node.

Detailed explanation-2: -Simple Linked List – In this type of linked list, one can move or traverse the linked list in only one direction. where the next pointer of each node points to other nodes but the next pointer of the last node points to NULL. It is also called “Singly Linked List”.

Detailed explanation-3: -The first node of the doubly linked list has NULL in its left pointer and the last node of the doubly linked list has NULL in its right pointer. It is also known as a two-way linked list as there are two pointers. The benefit of this doubly linked list is that now we can navigate in both directions.

Detailed explanation-4: -False, In a doubly linked list we can obtain the link to the previous node in O(1) hence the deletion of the node can be done in O(1). Hence the statement is incorrect. Option 4: A node in a doubly linked list can be deleted in O(1) if a pointer to the next node is given.

There is 1 question to complete.