mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-04-24 14:29:38 +00:00
[PR #1502] Create Doubly_linkedlist.c #2105
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/1502
State: closed
Merged: No
This C program implements a Doubly Linked List (DLL), a linear data structure in which each node contains three parts — data, a pointer to the previous node, and a pointer to the next node. Unlike a singly linked list, a doubly linked list allows bidirectional traversal, enabling easier insertion and deletion from both ends of the list.
The program provides a menu-driven interface that allows users to:
Insert a node at the beginning of the list
Insert a node at the end of the list
Delete a specific node by its value
Display the list in forward order (from head to tail)
Display the list in reverse order (from tail to head)
It uses dynamic memory allocation (malloc) for creating new nodes and ensures that node connections are properly updated during insertions and deletions. The program continues running until the user chooses to exit.
Description of Change
References
Checklist
Notes: