- Disadvantages of Arrays
- Linked List Introduction
- Single Linked List
- Double Linked List
- Circular Linked List
- Unrolled linked list
Problems:
- Implement Stack using Linked List - 1.Problem.cpp
- Find nth node from end of Linked List - Problem2
- Implementation1 : Brute force method using recursive_function. Complexity->O(n2)
- Implementation2 : Get the total length of the list and use lenth-n+1 to find the node Complexity->O(n)
- Implementation3 : Best Method - To solve problem in one scan use two ptrs, move one till it reaches nth, then start 2nd one till first one hits end of list
- Find if Linked List has loop and what is the length of loop - used slow_ptr and fast_ptr, Problem3
No comments:
Post a Comment