Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
amaitou authored Jul 25, 2024
1 parent a570bc7 commit 34dae6d
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions linkedlist/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
![Singlelinkedlist](https://github.com/user-attachments/assets/604a55db-e939-489c-a0e5-271e103b2c08)
---

# Introduction to LinkedList

Expand All @@ -7,15 +10,26 @@ A linked list is a linear data structure where elements are stored in nodes, wit

### Different Types of Linked Lists

- **Singly Linked List** -> Each node points to the next node in the sequence.
- **Doubly Linked List** -> Each node points to both the next and the previous nodes.
- **Singly Linked List**

Each node points to the next node in the sequence.

![singly-linkedlist](https://github.com/user-attachments/assets/49785f90-fe02-4be9-892d-fa2aca196f53)


- **Doubly Linked List**

Each node points to both the next and the previous nodes.

![DLL1](https://github.com/user-attachments/assets/63b9a7bb-c254-4aed-bc24-913c5cc76a79)


---

### Difference Between Singly and Doubly Linked Lists

- Singly Linked List -> Simpler to implement, uses less memory as each node only has one pointer.
- Doubly Linked List -> More complex due to additional pointer, but allows for easier traversal both forwards and backwards.
- **Singly Linked List** -> Simpler to implement, uses less memory as each node only has one pointer.
- **Doubly Linked List** -> More complex due to additional pointer, but allows for easier traversal both forwards and backward.

---

Expand Down Expand Up @@ -116,4 +130,4 @@ dll.display()

- Web Browser History: Allows easy navigation forward and backward.
- Music Playlists: Enables navigating to the next and previous songs efficiently.
- Undo/Redo Functionality: Supports going back and forth in a sequence of actions.
- Undo/Redo Functionality: Supports going back and forth in a sequence of actions.

0 comments on commit 34dae6d

Please sign in to comment.