Linked List Data Structures

CAN I ASK FOR A REFERENCE?

Passport office employees process peoples’ applications
Image courtesy of Global News

SINGLE VS DOUBLE

class Node 
{constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
class Node 
{constructor(data, next = null) {
this.data = data;
this.next = next;
// Without this you can't access the node before
this.prev = prev;
}
}
class Node { 
constructor(data, next = null){
this.head = head;
this.size = 0;
}
}

CURRENT

HEAD.next.next.next.next.next... 

SO WHY LINKED LISTS OVER ARRAYS?

Depiction of changes to an array vs changes to a linked list.
Depiction of changes to an array vs changes to a linked list.
Diagram property of InterviewBit

CONCLUSION

References

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store