DEV Community

Laxman Nemane
Laxman Nemane

Posted on

🔗 Linked List Explained Simply (Singly vs Doubly)

📚 Today I learned the Linked List concept in DSA

I just read Linked List and now I'll teach it. Linked List is one of the most beautiful concepts where most data manipulation happens, like insertion and deletion. For these operations, Linked List is the best use case.

🔹 We'll learn what a Linked List is. Basically, there are two types of Linked Lists:
1️⃣ Singly Linked List
2️⃣ Doubly Linked List

➡️ Singly Linked List means each node links to the next node. A node contains a value and a reference to the next node. This flow continues by connecting to the next node reference, which is why it is called singly.

↔️ The same thing happens in Doubly Linked List, but in this case the node has two pointers:
Next
Previous position reference

📌 An additional thing: the first node in a Linked List is technically called the head, and the last node is called the tail. The tail points to null.

This is what I learned today.

🧠 We also have an exercise for tech leaders and coders. If you know or you are learning, then solve this puzzle:

addelementatindex(2,8) in 3,1,4,5
➡️ 3,1,8,4,5

Top comments (0)