Adarsh Gupta⚑
Adarsh Gupta⚑

@Adarsh____gupta

13 Tweets 1 reads Dec 06, 2022
Data Structures in JavaScript πŸš€
Linked List and beyond πŸ‘‡πŸ»
(Drop πŸ”₯ for PDF version)
🧠 A linked list is a linear collection of data elements whose order is not given by their physical placement in memory.
A node(element in LL) has its data and reference to the next item
Let's Break it Down🀩
Check out the Detailed Blog for the same with extra info:
@adarsh-gupta/data-structure-in-javascript-f11d3fe83ce2" target="_blank" rel="noopener" onclick="event.stopPropagation()">medium.com
βœ“ Creating a Node first
A node is a Structure for LinkedListNode
βœ“ Now let's Create a LinkedList Class
Head: for storing the first node
Tail: for holding the Last node
We have our Node as well as LinkedList Class.
Now let's begin the actual fun
Let's add a new Node to our Empty LinkedList
βœ“ This is how you add a single node to LinkedList
βœ“ Let's make a function to add a node at the head
While adding a new node, the new Node should point to the current head Node and then the head should point to the new node
βœ“ Adding to the Tail of a Linked List
βœ“Removing from Head
Now I want you to try these operations
βœ“ Reverse a LinkedList
βœ“ Delete a node from the beginning
βœ“ Traverse the LinkedList
If you did these, post your code Screenshots below
Join my Email List so you don't Miss anything
getrevue.co
That's it, how was your journey?
Do your assignments😁
β˜… Retweet and Like this post, as it is the best way to support me
Hey I'm Adarsh I post content on
✭ Web development
✭ JavaScript
✭ ReactJS
✭ ThreeJS

Loading suggestions...