Let’s Dive Deeper Into DSA

Let’s Dive Deeper Into DSA

C++/Java/Python. Make sure that you are comfortable with the basic concepts of programming.

Things to do :

  • Things to Know in C++/Java/Python or any language.
    → User Input/Output.
    → Data Types
    → If Else statement
    → Switch Statement
    → Arrays, Strings
    → For Loop
    → While Loop
    → Function
    → Time Complexity

  • Build up Logical Thinking.
    → Practice Pattern Questions from any source like Leetcode.

  • Learn STL/Java-Collections or similar things in your language.

  • Basic Maths.
    → Count Digits
    → Reverse a Number
    → Check Palindrome
    → GCD or HCF
    → Armstrong Number
    → Print all Divisors
    → Check for Prime

  • Learn Basic Recursion.
    → Understand recursion by printing something N times
    → Print name N times using recursion
    → Print 1 to N using recursion
    → Print N to 1 using recursion
    → Sum of first N numbers
    → Factorial of N numbers
    → Reverse an array
    → Check if a string is a palindrome or not
    → Fibonacci Number

  • Learn Basic Hashing.
    → Counting frequencies of array elements
    → Find the highest/lowest frequency element

Day 1 to 10: Sorting

Things to do:

  • Selection Sort

  • Bubble Sort

  • Insertion Sort

  • Merge Sort

  • Quick Sort

  • Cycle Sort

  • Heap Sort

Things to do:

  • Binary Search on 1D Arrays

→ Binary Search to find X in Sorted Array
→ Lower Bound and Upper Bound
→ Search Insert Position
→ Check if the Input array is sorted
→ Find the first and last occurrence of a given number in a sorted array
→ Count the occurrence of a number in a sorted array with duplicates
→ Find peak element
→ Search in Rotated Sorted Array I
→ Search in Rotated Sorted Array II
→ Find Minimum in Rotated Sorted Array
→ Single element in a sorted Array
→ Find the kth element of two sorted arrays
→ Find out how many times has an array been rotated
→ Order-Agnostic Binary Search

  • Binary Search on 2D Arrays
    → Search in a 2D matrix
    → Find the Peak Element
    → Matrix Median

  • Find Answers by Binary Search in Search Space
    → Find the square root of a number in log n
    → Find the Nth root of a number using BS
    → Koko Eating Bananas
    → Minimum days to make M bouquets
    → Find the smallest Divisor
    → Capacity to Ship Packages within D Days
    → Median of two sorted arrays
    → Aggressive Cows
    → Book Allocation Problem
    → Split array-Largest Sum
    → Kth Missing Positive number
    → Minimize Max Distance to Gas Station
    → Median of 2 sorted arrays
    → Kth element of 2 sorted arrays

Day 26–30: Strings

Things to do:

  • Basic
    → Remove outermost Paranthesis
    → Reverse words in a given string/Palindrome Check
    → Largest odd number in a string
    → Longest Common Prefix
    → Isomorphic String
    → check whether one string is a rotation of another
    → Check if two strings are anagrams of each other

  • Medium String Problem
    → Sort Characters by frequency
    → Maximum Nesting Depth of Paranthesis
    → Roman Number to Integer and vice versa
    → Implement Atoi
    → Count the Number of Substrings
    → Longest Palindromic Substring
    → Sum of Beauty of all substring
    → Reverse Every Word in A String

Day 31–41: LinkedList

Things to do:

  • 1D LinkedList

  • Doubly LinkedList

  • Medium-Level Problems of LL
    Middle of a LinkedList Reverse a LinkedList
    Detect if the linked list has a cycle in it
    Find the starting point in LL
    → Length of Loop in LL
    → Check if LL is palindrome or not
    → Segregate odd and even nodes in LL
    → Remove the Nth node from the back of the LL
    → Delete the middle node of the LL
    → Sort LL
    → Sort a LL of 0’s and 1’s by changing links
    → Find the intersection point of Y LL
    → Add 1 to a number represented by LL
    → Add two numbers in LL

  • Medium-Level Problems of DLL
    →Delete all occurrences of a key in DLL
    → Find pairs with given sum in DLL
    → Remove duplicates from sorted DLL

  • Hard Level Problems of LL
    → Reverse LL in a group of given size K
    →Rotate a LL
    → Flattening of LL
    → Clone a LinkedList with random and next pointer

Day 42–62: Recursion

Things to do:

Day 63–65: Bit Manipulation

Things to do:

Day 65–75: Stack and Queues

Things to do:

Day 75–85: Greedy Algorithms

Things to do:

Day 86–101: Binary Tree

Things to do:

  • Basic
    → Basic tree structure
    → Traversing a Binary Tree (Preorder, Postorder, Inorder)
    → Balanced Binary Search Tree

  • Problems
    → Find the height or depth of a binary tree
    → Finding the Diameter of a Tree using the height of each node
    →Find the number of Universal Value subtrees in a Binary Tree
    → Find if a given Binary Tree is a Sub-Tree of another Binary Tree
    → Finding nodes at a distance K from a given node
    → Copy a binary tree where each node has a random pointer
    → Zigzag Traversal of Binary Tree
    → Check if Binary Tree is foldable
    → Threaded Binary Tree
    → Convert Binary Tree to Threaded Binary Tree
    → Sum of k smallest elements in Binary Search Tree

Day 102–111: Graphs

Things to do:

  • BFS/DFS

  • Shortest path Algo

  • Minimum spanning tree

  • Union-Find

Refer: link

Day 112–120: Dynamic Programming

Things to do:

List Of LeetCode Most Asked Questions - Click Here