Question d’entretien chez Capgemini

Difference between Singly linked list and doubly linked list?

Réponse à la question d'entretien

Utilisateur anonyme

16 févr. 2025

A Singly Linked List (SLL) and a Doubly Linked List (DLL) are both types of linked lists, but they differ in structure and functionality. 1. Structure: Singly Linked List: Each node contains data and a pointer to the next node. The last node points to NULL. Memory-efficient because it uses only one pointer per node. Doubly Linked List: Each node contains data, a pointer to the next node, and a pointer to the previous node. The last node's next is NULL, and the first node's prev is NULL. Requires extra memory for storing the previous pointer.