DEV Community

Cover image for Frontend Interview Preparation Day 2 - Linked List
Nishant Singh
Nishant Singh

Posted on • Edited on

Frontend Interview Preparation Day 2 - Linked List

Hi there 🙏, today is June 22, 2024. So, I woke up at 7 AM ⏰ today, did some morning walk, yoga for 30 mins. Went to temple & then started the routine.

Today's Plan - 💯

  • June 22 (Sat): Study linked lists, practice easy problems. (4 hours)

Watch the videos for linked list from Udemy Course.
Master the Coding Interview: Data Structures + Algorithms

✅ What is linked list? ⛓️

  • A linked list is a linear data structure that stores a collection of data elements dynamically.
  • Nodes represent those data elements, and links or pointers connect each node.
  • Each node consists of two fields, the information stored in a linked list and a pointer that stores the address of its next node.
  • The last node contains null in its second field because it will point to no node.
  • A linked list can grow and shrink its size, as per the requirement.
  • It does not waste memory space.

✅ The linked list mainly has three types, they are:

  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List

Image description

✅ Essential Operation on Linked Lists 🚥

  1. Traversing: To traverse all nodes one by one.
  2. Insertion: To insert new nodes at specific positions.
  3. Deletion: To delete nodes from specific positions.
  4. Searching: To search for an element from the linked list.

✅ Application of a Linked List

  • A linked list is used to implement stacks and queues.
  • A linked list also helps to implement an adjacency matrix graph.
  • It is used for the dynamic memory location.
  • The linked list makes it easy to deal with the addition and multiplication of polynomial operations.
  • Implementing a hash table, each bucket of the hash table itself behaves as a linked list.
  • It is used in a functionality known as undo in Photoshop and Word.
  • With that, you have reached the end of this tutorial on Linked Lists.

✅ Some leet code question which I solved today 👨‍💻

  1. linked-list-cycle
  2. Merge Two Sorted Lists
  3. Remove Duplicates from Sorted List
  4. Intersection of Two Linked Lists

All the above leet code questions are solved from my end, I hope you will also try the same. If you can't solve it no problem. Learn it and try again. Never give up.

Always remember, your career is a marathon, not a sprint.

✅ Checkout some of my post

Frontend Interview Preparation

MAANG Interview Preparation Day 1 - The Plan

Top comments (0)