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:
- Singly Linked List
- Doubly Linked List
- Circular Linked List
✅ Essential Operation on Linked Lists 🚥
- Traversing: To traverse all nodes one by one.
- Insertion: To insert new nodes at specific positions.
- Deletion: To delete nodes from specific positions.
- 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 👨💻
- linked-list-cycle
- Merge Two Sorted Lists
- Remove Duplicates from Sorted List
- 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
Top comments (0)