Skip to content

THIS IS MY DSA JOURNEY WHICH I DOCUMENTED , TO LEARN AND HELP NEWBIES TO START DSA

Notifications You must be signed in to change notification settings

kushkumarkashyap7280/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

174 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ LeetCode GeeksforGeeks GitHub

DSA PROBLEM SOLVING JOURNEY

C++ LeetCode GeeksforGeeks Data Structures Algorithms

LeetCode Stats

📚 Access Topicwise & Difficultywise Problem Lists

📂 Daily Folders Quick Access

Basics and Setup

  • Day 001 - Basic C++ Syntax and Introduction - 21 April, 2025
  • Day 002 - First Program and Comments - 22 April, 2025
  • Day 003 - Variables, Data Types, and I/O - 23 April, 2025
  • Day 004 - Input/Output and Operators - 24 April, 2025

Control Flow and Functions

  • Day 005 - If-Else and Switch Statements - 25 April, 2025
  • Day 006 - Loops and Their Types - 26 April, 2025
  • Day 007 - Functions and Pointers - 27 April, 2025
  • Day 008 - Scope and Basic Functions - 28 April, 2025
  • Day 009 - Pattern Problems - 29 April, 2025
  • Day 010 - Bitwise Operators - 30 April, 2025

Data Structures Classification

Welcome to my DSA learning repository! Here I document my journey of solving LeetCode problems and mastering data structures and algorithms.

<------------ARRAY --------->

Day 11 View Code - 01 May, 2025

  • Array Problems
  1. 1. Two Sum (LeetCode) - Easy (C++ Solution)
  2. 3550. Smallest Index With Digit Sum Equal to Index (LeetCode) - Easy (C++ Solution)

Day 12 View Code - 02 May, 2025

  • Matrix Problems
  1. 1572. Matrix Diagonal Sum (LeetCode) - Easy (C++ Solution)

Day 13 View Code - 03 May, 2025

  • Binary Search Problems
  1. First and Last Occurrence (Coding Ninjas) - Easy (C++ Solution)
  2. 724. Find Pivot Index (LeetCode) - Easy (C++ Solution)
  3. 852. Peak Index in a Mountain Array (LeetCode) - Medium (C++ Solution)
  4. Binary Search Implementation (C++ Solution)

Day 14 View Code - 04 May, 2025

  • Rotated Array Problems
  1. Pivot in Rotated Array (C++ Solution)
  2. 33. Search in Rotated Sorted Array (LeetCode) - Medium (C++ Solution)
  3. Find if Given Element Present in Rotated Array (C++ Solution)
  4. Square Root Using Binary Search (C++ Solution)

Day 15 View Code - 05 May, 2025

  • Square Root Problems
  1. Square Root with Decimal Precision (GeeksForGeeks) - Medium (C++ Solution)

Day 16 View Code - 06 May, 2025

  • Binary Search Problems
  1. Book Allocation Problem (GeeksForGeeks) - Medium (C++ Solution)
  2. Painter's Partition Problem (C++ Solution)

Day 17 View Code - 07 May, 2025

  • Advanced Search Problems
  1. Aggressive Cows (GeeksForGeeks) - Medium
  2. EKO - Wood Cutting (SPOJ) - Medium

Day 18 View Code - 08 May, 2025

  • SPOJ Problems
  1. PRATA - Roti Prata (SPOJ) - Medium

Day 19 View Code - 09 May, 2025

  • Basic Sorting Algorithms
  1. Selection Sort (GeeksForGeeks) - Easy
  2. Bubble Sort (GeeksForGeeks) - Easy

Day 20 View Code - 10 May, 2025

  • Sorting Algorithms
  1. Insertion Sort (GeeksForGeeks) - Easy

Day 21 View Code - 11 May, 2025

  • STL Data Structures
    1. Vector (Dynamic Array)
      • Definition: A dynamic array that can grow/shrink in size
      • Use Cases: Dynamic size collections, frequent access by index
      • Key Methods:
        • push_back() - Add element at end
        • pop_back() - Remove last element
        • size() - Get current size
        • capacity() - Get current capacity
        • clear() - Remove all elements
    2. Stack (LIFO)
      • Definition: Last-In-First-Out data structure
      • Use Cases: Function calls, undo operations, expression evaluation
      • Key Methods:
        • push() - Add element on top
        • pop() - Remove top element
        • top() - Access top element
        • empty() - Check if stack is empty
    3. Queue (FIFO)
      • Definition: First-In-First-Out data structure
      • Use Cases: Print spooler, task scheduling, BFS algorithms
      • Key Methods:
        • push() - Add element at back
        • pop() - Remove front element
        • front() - Access first element
        • back() - Access last element
    4. List (Doubly Linked List)
      • Definition: Double-linked list with nodes containing prev/next pointers
      • Use Cases: Frequent insertions/deletions at any position
      • Key Methods:
        • push_back() - Add at end
        • push_front() - Add at beginning
        • insert() - Add at position
        • erase() - Remove element
    5. Deque (Double-ended Queue)
      • Definition: Double-ended queue allowing insertions/deletions at both ends
      • Use Cases: Sliding window problems, work stealing algorithms
      • Key Methods:
        • push_back() - Add at back
        • push_front() - Add at front
        • pop_back() - Remove from back
        • pop_front() - Remove from front
    6. Array (Fixed-size Array)
      • Definition: Fixed-size container with contiguous memory
      • Use Cases: When size is known and fixed, cache-friendly operations
      • Key Methods:
        • at() - Access with bounds checking
        • front() - Access first element
        • back() - Access last element
        • fill() - Fill array with value
        • size() - Get array size

Day 22 View Code - 12 May, 2025

  • Advanced STL
    1. Priority Queue
      • Definition: A container adaptor that provides constant time lookup of the largest/smallest element
      • Use Cases: Task scheduling, Dijkstra's algorithm
      • Key Methods:
        • push() - Add element
        • pop() - Remove top element
        • top() - Access top element
        • empty() - Check if empty
    2. Set
      • Definition: Sorted container that stores unique elements
      • Use Cases: Maintaining unique elements, ordered data
      • Key Methods:
        • insert() - Add element
        • erase() - Remove element
        • find() - Search element
        • count() - Count occurrences
    3. Map
      • Definition: Sorted key-value pair container
      • Use Cases: Dictionaries, frequency counting
      • Key Methods:
        • insert() - Add pair
        • erase() - Remove pair
        • find() - Search key
        • [] - Access/modify value
    4. STL Algorithms
      • Definition: Common algorithms for containers
      • Key Functions:
        • sort() - Sort elements
        • binary_search() - Binary search
        • reverse() - Reverse elements
        • min/max_element() - Find min/max

Day 23 View Code - 13 May, 2025

  • Array Manipulation
  1. Reverse Array from Position M (GeeksForGeeks) - Easy

Day 24 View Code - 14 May, 2025

  • Array Problems
  1. Merge Sorted Arrays (LeetCode) - Easy
  2. Move Zeroes (LeetCode) - Easy

Day 25 View Code - 15 May, 2025

  • Array Rotation Problems
  1. Rotate Array (LeetCode) - Medium
  2. Check if Array is Sorted and Rotated (LeetCode) - Easy

Day 26 View Code - 16 May, 2025

  • Array Addition
  1. Sum of Two Arrays - Easy

<----------STRING---------->

Day 27 View Code - 17 May, 2025

  • Character Arrays & Strings
  1. Character Arrays

    • Definition: Fixed-size array to store sequence of characters
    • Declaration & Initialization:
      char str[10] = "hello";     // Method 1
      char str[] = {'h','e','l','l','o','\0'};  // Method 2
    • Common Operations:
      • Length: strlen(str)
      • Copy: strcpy(dest, src)
      • Compare: strcmp(str1, str2)
      • Concatenate: strcat(str1, str2)
    • Limitations:
      • Fixed size
      • Manual null termination
      • No built-in operations
  2. String Class

    • Definition: Dynamic string container with built-in methods
    • Declaration & Initialization:
      string str = "hello";      // Method 1
      string str("hello");       // Method 2
    • Most Used Methods:
      • str.length() / str.size() - Get length
      • str1 + str2 - Concatenate
      • str.substr(pos, len) - Get substring
      • str.find("pattern") - Search pattern
      • getline(cin, str) - Input with spaces
  3. Solved Problems:

Day 28 View Code - 18 May, 2025

  • Array Properties
  1. Monotonic Array (LeetCode) - Easy

Day 29 View Code - 19 May, 2025

  • String Manipulation
  1. Reverse Words in String (LeetCode) - Medium

Day 30 View Code - 20 May, 2025

  • String Manipulation Problems
  1. Maximum Occurring Character (GeeksForGeeks) - Easy
  2. Replace Spaces with @40 (Naukri Code360) - Easy
  3. Remove All Occurrences of a Substring (LeetCode) - Medium
  4. Permutation in String (LeetCode) - Medium
  5. Remove Adjacent Duplicates (LeetCode) - Easy

Day 31 View Code - 21 May, 2025

  • String Compression
  1. String Compression (LeetCode) - Medium

<----------2D - ARRAY -------->

Day 32 View Code - 22 May, 2025

  1. Search a 2D Matrix (LeetCode) - Medium
  2. Transpose Matrix (LeetCode) - Easy
  3. Convert 1D Array Into 2D Array (LeetCode) - Easy

Day 33 View Code - 23 May, 2025

  1. Print Like A Wave (Naukri Code360) - Medium

Day 34 View Code - 24 May, 2025

  • 2D Matrix Problems
  1. 48. Rotate Image (LeetCode) - Medium (C++ Solution)
  2. 54. Spiral Matrix (LeetCode) - Medium (C++ Solution)
  3. 240. Search a 2D Matrix II (LeetCode) - Medium (C++ Solution)
  4. 2942. Find Words Containing Character (LeetCode) - Easy (C++ Solution)

Day 35 View Code - 25 May, 2025

  • Number Theory & Sieve Problems
  1. 204. Count Primes (LeetCode) - Medium (C++ Solution)
  2. 7. Reverse Integer (LeetCode) - Easy (C++ Solution)
  3. Regular Sieve of Eratosthenes vs Segmented Sieve (C++ Solution)
  4. HCM (Highest Common Factor) Algorithm (C++ Solution)

Day 36 View Code - 26 May, 2025

  • Math & Advanced Problems
  1. 50. Pow(x, n) (LeetCode) - Medium (C++ Solution)
  2. Catalan Number Implementations (C++ Solution)

Day 37 View Code - 27 May, 2025

  • C++ Pointers & LeetCode
  1. Pointers in C++ (C++ Solution)
  2. 2894. Divisible and Non-divisible Sums Difference (LeetCode) - Easy (C++ Solution)

Resources:

  • C++ Memory Management Notes

  • Code Examples: Memory allocation, Smart pointers

  • Topics: C++ Memory Management, Smart Pointers, Dynamic Memory

  • Difficulty: Intermediate

  • Language: C++

Day 38 View Code - 28 May, 2025

  • C++ References & Dynamic Memory
  1. Reference Variables (C++ Solution)
  2. Dynamic Memory Allocation (C++ Solution)
  3. 2D Array Dynamic Allocation (C++ Solution)
  4. 26. Remove Duplicates from Sorted Array (LeetCode) - Easy (C++ Solution)

Resources:

Day 39 View Code - 29 May, 2025

Problems Solved:

Day 40 View Code - 30 May, 2025

Day 41 View Code - 31 May, 2025

  • C++ Macros Deep Dive
    • Object-like Macros
    • Function-like Macros
    • Multi-line Macros
    • Conditional Compilation
    • Stringizing & Token Pasting
    • Predefined Macros
  • Implementation: macros.cpp
  • Topic: C++ Preprocessor Directives
  • Difficulty: Intermediate
  • Language: C++

Day 42 View Code - 1 june

<----- RECURSION ------->

  1. Fibonacci Number (LeetCode) - Easy

Day 43 View Code - 2 june

  1. Candy Distribution (LeetCode) - Hard
  2. Add Strings (LeetCode) - Easy

Day 44 View Code - 3 june

  • Mathematical Algorithms & Optimizations
  1. Multiply Strings (LeetCode) - Medium

  2. Sum Multiples (LeetCode) - Easy

Day 45 View Code - 4 june

  • Array In-Place Operations
  1. Remove Element (LeetCode) - Easy

Day 46 View Code - 5 june, 2025

  1. Search Insert Position (LeetCode) - Easy

Day 47 View Code - 6 june, 2025

  1. Find First and Last Position (LeetCode) - Medium

Day 48 View Code - 7 june, 2025

  1. Length of Last Word (LeetCode) - Easy

Day 49 View Code - 8 june, 2025

  1. Plus One (LeetCode) - Easy

Day 50 View Code - 9 june, 2025

  1. Add Binary (LeetCode) - Easy

Day 51 View Code - 10 june, 2025

  1. Maximum Difference Between Even and Odd Frequency (LeetCode) - Easy

Day 52 View Code - 11 june, 2025

  1. Best Time to Buy and Sell Stock (LeetCode) - Easy

Day 53 View Code - 12 june, 2025

  1. Maximum Difference Between Adjacent Elements in a Circular Array (LeetCode) - Easy

Day 54 View Code - 13 june, 2025

  1. Contains Duplicate (LeetCode) - Easy

Day 55 View Code - 14 june, 2025

  1. Longest Common Prefix (LeetCode) - Easy

Day 56 View Code - 15 june, 2025

  1. Longest Substring Without Repeating Characters (LeetCode) - Medium

Day 57 View Code - 16 june, 2025

  1. Maximum Difference Between Increasing Elements (LeetCode) - Easy

Day 58 View Code - 17 june, 2025

  1. Valid Parentheses (LeetCode) - Easy

Day 59 View Code - 18 june, 2025

  1. Single Number (LeetCode) - Easy

Day 60 View Code - 19 june, 2025

  1. Majority Element (LeetCode) - Easy

Day 61 View Code - 20 june, 2025

  1. Excel Sheet Column Title (LeetCode) - Easy
  2. Recursion Problems: Array Sum, Linear Search, Binary Search
    • Topic: Recursion in Arrays
    • Problems:
      • Sum of Array Elements (Recursive)
      • Linear Search (Recursive)
      • Binary Search (Recursive)
    • Language: C++
    • Key Concepts:
      • Recursion
      • Divide and Conquer
      • Array Traversal
      • Time: O(n) for sum/linear search, O(log n) for binary search
      • Space: O(n) for sum/linear search, O(log n) for binary search

Day 62 View Code - 21 june, 2025

  1. 3Sum (LeetCode) - Medium
  2. Generate Tag for Video Caption (LeetCode) - Easy

Day 63 View Code - 22 june, 2025

  • Power of Three (LeetCode) - Easy
  • bubble sorting using recursion.
  • string and some integer related recursion problems.

<--------SORTING------->

Day 64 View Code - 23 june, 2025

Day 65 View Code - 24 june, 2025

📊 Sorting Algorithms Comparison

Algorithm Best Time Average Time Worst Time Space Stable Best For
Selection Sort O(n^2) O(n^2) O(n^2) O(1) No Small arrays, when memory is very limited
Bubble Sort O(n) O(n^2) O(n^2) O(1) Yes Educational, nearly sorted arrays
Insertion Sort O(n) O(n^2) O(n^2) O(1) Yes Small/nearly sorted arrays, online sorting
Merge Sort O(n log n) O(n log n) O(n log n) O(n) Yes Large arrays, stable sort needed
Quick Sort O(n log n) O(n log n) O(n^2) O(log n)* No General purpose, fastest in practice

*Quick sort's space is O(log n) due to recursion stack (in-place otherwise).

Summary:

  • Merge Sort is best for large datasets and when stability is required.
  • Quick Sort is usually fastest for general use, but not stable and can degrade to O(n^2).
  • Insertion Sort is best for small or nearly sorted arrays.
  • Bubble/Selection Sort are mainly for teaching or very small arrays.

Day 66 View Code - 25 june, 2025

Day 67 View Code - 26 june, 2025

Subsets and Subsequences using Recursion

Day 68 View Code - 27 june, 2025

Day 69 View Code - 28 june, 2025

Day 70 View Code - 29 june, 2025

<--------OOPS--------->

Day 71 View Code - 30 june, 2025

  1. day problem Zigzag Conversion (LeetCode) - Medium (C++ Solution)

Day 72 View Code - 1 July, 2025

<----- LINKEDLIST ------->

  1. Find the Original Typed String I (LeetCode) - Easy (C++ Solution)

Day 73 View Code - 2 July, 2025

  1. 206. Reverse Linked List (C++ Solution)
  2. 19. Remove Nth Node From End of List (C++ Solution)
  3. 234. Palindrome Linked List (C++ Solution)
  4. 707. Design Linked List (C++ Solution)

Day 74 View Code - 3 July, 2025

  • Linked List Problems
  1. 876. Middle of the Linked List (LeetCode) - Easy (C++ Solution)
    • Approaches: Vector, Counting, Two Pointers (see README)
  2. Reverse Doubly Linked List (C++ Solution)
    • Approach: Swap next/prev pointers for each node (see README)

Day 75 View Code - 4 July, 2025

  • Linked List Advanced Problems
  1. 25. Reverse Nodes in k-Group (LeetCode) - Hard (C++ Solution, Detailed Discussion & Visuals)
  2. 141. Linked List Cycle (LeetCode) - Easy (C++ Solution, See README)
  3. 142. Linked List Cycle II (LeetCode) - Medium (C++ Solution, See README)

Day 76 View Code - 5 July, 2025

  • Array Problems
  1. 1394. Find Lucky Integer in an Array (LeetCode) - Easy (C++ Solution, Detailed Discussion & Visuals)

Day 77 View Code - 6 July, 2025

  • Linked List - Remove Duplicates & Loops
  1. 83. Remove Duplicates from Sorted List (LeetCode) - Easy (C++ Solution, See README)
  2. 82. Remove Duplicates from Sorted List II (LeetCode) - Medium (C++ Solution, See README)
  3. Remove Loop in Linked List (GFG) - Medium (C++ Solution, See README)

Day 78 View Code - 7 July, 2025

  • Linked List Practice & Sorting
  1. Merge Two Sorted Lists (LeetCode) - Easy (C++ Solution)
  2. Sort Colors (LeetCode) - Medium (C++ Solution)
  3. Sort linked list of 0s 1s 2s (Coding Ninjas) - Easy (C++ Solution)
  4. Remove duplicates from an unsorted linked list (GFG) - Easy (C++ Solution)

Day 79 View Code - 8 July, 2025

  • Linked List Advanced Problems
  1. 2. Add Two Numbers (LeetCode) - Medium (C++ Solution)
  2. 138. Copy List with Random Pointer (LeetCode) - Medium (C++ Solution)

Day 80 View Code - 9 July, 2025

Day 81 View Code - 10 July , 2025

  • Linked List Problems
  1. 61. Rotate List (LeetCode) - Medium (C++ Solution)

Custom STL: CircularList

A modern, STL-style circular doubly-linked list implemented from scratch:

  • Supports push_back, insert, erase, reverse, rotate, sort, clear, size, empty, head, tail
  • STL-style iterators: begin(), end(), at(index), cycle_begin() for infinite traversal
  • Fully documented and tested
  • See day_081/circular_list_STL/README.md for full details, usage, and examples
  • Try the demo or run the unit tests

<------- STACK ---------->

Day 82 View Code - 11 July , 2025

  1. 70. Climbing Stairs (LeetCode) - Easy (C++ Solution)
  2. 155. Min Stack (LeetCode) - Medium (C++ Solution)
  3. Two Stacks in an Array (Coding Ninjas) - Medium (C++ Solution)
  4. Stack Implementation using Array (C++ Solution)
  5. Stack Implementation using Linked List (C++ Solution)

Day 83 View Code - 12 July , 2025

  1. 2095. Delete the Middle Node of a Linked List (LeetCode) - Medium (C++ Solution)
  2. 1381. Design a Stack With Increment Operation (LeetCode) - Medium (C++ Solution)
  3. 3606. Coupon Code Validator (LeetCode) - Easy (C++ Solution)
  4. Delete Middle Element of a Stack (GeeksForGeeks) - Medium (C++ Solution)
  5. Reverse a Stack (GeeksForGeeks) - Medium (C++ Solution)
  6. Reverse a String Using Stack - Easy (C++ Solution)
  7. Insert An Element At Its Bottom In A Given Stack (Coding Ninjas) - Easy (C++ Solution)

Day 84: View Code - 13 July, 2025

  1. Process String with Special Operations I (Leetcode, Medium) (Question) (C++ Solution)
  2. Process String with Special Operations II (Leetcode, Medium) (Question) (C++ Solution)
  3. Sort a Stack (GeeksforGeeks, Medium) (Question) (C++ Solution)
  4. Redundant Brackets (Coding Ninjas, Easy) (Question) (C++ Solution)
  5. Minimum Cost To Make String Valid (Coding Ninjas, Medium) (Question) (C++ Solution)

Day 85: View Code - 14 July, 2025

  1. Next Smaller Element (Naukri Code360) - Medium (C++ Solution)

  2. 1290. Convert Binary Number in a Linked List to Integer (LeetCode) - Easy (C++ Solution)

  3. 32. Longest Valid Parentheses (LeetCode) - Hard (C++ Solution)

Day 86 View Code - 15 July, 2025

  • Stack and Miscellaneous Problems
  1. 3136. Valid Word (LeetCode) - Easy (C++ Solution)
  2. 901. Online Stock Span (LeetCode) - Medium (C++ Solution)
  3. 84. Largest Rectangle in Histogram (LeetCode) - Hard (C++ Solution)

Day 87 View Code - 16 July, 2025

  • Stack & Parity Problems
  1. The Celebrity Problem (GeeksforGeeks) - Medium (C++ Solution)
  2. 3201. Find the Maximum Length of Valid Subsequence I (LeetCode) - Medium (C++ Solution)

Day 88 View Code - 17 July, 2025

  • Stack & 2D Array Problems
  1. 85. Maximal Rectangle (LeetCode) - Hard (C++ Solution)
  2. N Stacks In An Array (Coding Ninjas) - Hard (C++ Solution)

Day 89 View Code - 18 July, 2025

  1. 23. Merge k Sorted Lists (LeetCode) - Hard (C++ Solution)

Day 90 View Code - 19 July, 2025

  • Stack Problems
  1. Design a Stack That Supports getMin in O(1) Time and O(1) Extra Space (Naukri Code360) - Medium (C++ Solution)
  2. 143. Reorder List (LeetCode) - Medium (C++ Solution)

<<--------------- QUEUE --------->>

Day 91 View Code - 20 July, 2025

  • Queue Problems
  1. 3622. Check Divisibility by Digit Sum and Product (LeetCode) - Easy (C++ Solution)
  2. STL Queue Demo (C++ Solution)
  3. Custom Queue Using Array (C++ Solution)
  4. Custom Queue Using Linked List (C++ Solution)

Day 92 View Code - 21 July, 2025

  • String & Queue Problems
  1. 1957. Delete Characters to Make Fancy String (LeetCode) - Easy (C++ Solution)
  2. 622. Design Circular Queue (LeetCode) - Medium (C++ Solution)
  3. Custom Circular Queue (C++ Solution)

Day 93 View Code - 22 July, 2025

  • Custom Queue Implementations
  1. Doubly Ended Queue (Deque) - (C++ Solution)
  2. Input-Restricted Queue - (C++ Solution)
  3. Output-Restricted Queue - (C++ Solution)
  4. 641. Design Circular Deque (LeetCode) - Medium (C++ Solution)

Day 94 View Code - 23 July, 2025

  • Linked List & Queue Problems
  1. 203. Remove Linked List Elements (LeetCode) - Easy (C++ Solution)
  2. Queue Reversal (GeeksForGeeks) - Easy (C++ Solution)

Day 95 View Code - 24 July, 2025

  • Queue & String Problems
  1. 387. First Unique Character in a String (LeetCode) - Easy (C++ Solution)
  2. First Non-repeating Character in a Stream (GeeksForGeeks) - Medium (C++ Solution)
  3. Reverse First K Elements of Queue (GeeksForGeeks) - Medium (C++ Solution)
  4. First Negative Integer in Every Window of Size K (GeeksForGeeks) - Medium (C++ Solution)

Day 96 View Code - 25 July, 2025

  1. 134. Gas Station (LeetCode) - Medium (C++ Solution)
  2. 225. Implement Stack using Queues (LeetCode) - Easy (C++ Solution)
  3. 232. Implement Queue using Stacks (LeetCode) - Easy (C++ Solution)
  4. Interleave the First Half of the Queue with Second Half (GeeksForGeeks) - Medium (C++ Solution)

Day 97 View Code - 26 July, 2025

  1. 24. Swap Nodes in Pairs (LeetCode) - Medium (C++ Solution)
  2. Sum of Max and Min of Window K in Array (GeeksforGeeks) - Medium (C++ Solution)
  3. N Queues in an Array (Naukri Code360) - Medium (C++ Solution)

<--------- BINARY TREE --------->

Day 98 View Code - 27 July, 2025

  1. Binary Tree Implementation - Comprehensive tree operations
  2. Count Leaves in Binary Tree (GeeksForGeeks) - Easy (C++ Solution)
  3. 222. Count Complete Tree Nodes (LeetCode) - Medium (C++ Solution)
  4. 3627. Maximum Median Sum of Subsequences of Size 3 (LeetCode) - Medium (C++ Solution)

Day 99 View Code - 28 July, 2025

  • Advanced Binary Tree Problems and Tree Properties (See Details)
  1. Height of Binary Tree - Comprehensive tree height calculation
  2. 543. Diameter of Binary Tree (LeetCode) - Easy (C++ Solution)
  3. 110. Balanced Binary Tree (LeetCode) - Easy (C++ Solution)
  4. 100. Same Tree (LeetCode) - Easy (C++ Solution)
  5. Sum Tree (GeeksForGeeks) - Medium (C++ Solution)

Day 100 View Code - 29 July, 2025

  • Binary Tree Traversal and Tree Properties (See Details)
  1. 101. Symmetric Tree (LeetCode) - Easy (C++ Solution)
  2. 102. Binary Tree Level Order Traversal (LeetCode) - Medium (C++ Solution)
  3. 103. Binary Tree Zigzag Level Order Traversal (LeetCode) - Medium (C++ Solution)
  4. 104. Maximum Depth of Binary Tree (LeetCode) - Easy (C++ Solution)
  5. 107. Binary Tree Level Order Traversal II (LeetCode) - Medium (C++ Solution)
  6. 94. Binary Tree Inorder Traversal (LeetCode) - Easy (C++ Solution)

Day 101 View Code - 30 July, 2025

  • Advanced Binary Tree Traversal and Tree Properties (See Details)
  1. Boundary Traversal of Binary Tree (GeeksForGeeks) - Medium (C++ Solution)
  2. 199. Binary Tree Right Side View (LeetCode) - Medium (C++ Solution)
  3. 987. Vertical Order Traversal of Binary Tree (LeetCode) - Hard (C++ Solution)

Day 102 View Code - 31 July, 2025

  1. Top View of Binary Tree (GeeksForGeeks) - Medium (C++ Solution)
  2. Bottom View of Binary Tree (GeeksForGeeks) - Medium (C++ Solution)
  3. Diagonal Traversal of Binary Tree (GeeksForGeeks) - Medium (C++ Solution)
  4. 513. Find Bottom Left Tree Value (LeetCode) - Medium (C++ Solution)

Day 103 View Code - 1 August, 2025

  1. 112. Path Sum (LeetCode) - Easy (C++ Solution)
  2. 437. Path Sum III (LeetCode) - Medium (C++ Solution)
  3. 1161. Maximum Level Sum of Binary Tree (LeetCode) - Medium (C++ Solution)
  4. Sum of Nodes on the Longest Path (GeeksForGeeks) - Medium (C++ Solution)
  5. 236. Lowest Common Ancestor of a Binary Tree (LeetCode) - Medium (C++ Solution)

Day 104 View Code - 2 August, 2025

  1. 1483. Kth Ancestor of a Tree Node (LeetCode) - Hard (C++ Solution)
  2. Maximum Sum of Non-adjacent Nodes (GeeksForGeeks) - Medium (C++ Solution)

Day 105 View Code - 3 August, 2025

  • Array Patterns and Binary Tree Construction (See Details)
  1. 3637. Trionic Array I (LeetCode) - Easy(C++ Solution)
  2. 105. Construct Binary Tree from Preorder and Inorder Traversal (LeetCode) - Medium (C++ Solution)
  3. 106. Construct Binary Tree from Inorder and Postorder Traversal (LeetCode) - Medium (C++ Solution)

Day 106 View Code - 4 August, 2025

  1. 80. Remove Duplicates from Sorted Array II (LeetCode) - Medium (C++ Solution)
  2. 81. Search in Rotated Sorted Array II (LeetCode) - Medium (C++ Solution)

Day 107 View Code - 5 August, 2025

  1. 237. Delete Node in a Linked List (LeetCode) - Medium (C++ Solution)

Day 108 View Code - 6 August, 2025

  • Binary Tree Problems and Morris Traversal (See Details)
  1. 2385. Amount of Time for Binary Tree to Be Infected (LeetCode) - Medium (C++ Solution)
  2. Morris Traversal Implementation (GeeksForGeeks) - Advanced (C++ Solution)
  3. 114. Flatten Binary Tree to Linked List (LeetCode) - Medium (C++ Solution)

<----------------- BINARY SEARCH TREE --------------->

Day 109 View Code - 7 August, 2025

  • Binary Search Tree Fundamentals and Operations (See Details)
  1. Binary Search Tree Implementation - Complete BST with basic operations (C++ Solution)
  2. 700. Search in a Binary Search Tree (LeetCode) - Easy (C++ Solution)
  3. 701. Insert into a Binary Search Tree (LeetCode) - Medium (C++ Solution)
  4. 1008. Construct Binary Search Tree from Preorder Traversal (LeetCode) - Medium (C++ Solution)

Day 110 View Code - 8 August, 2025

  • Binary Search Tree Operations and Linked List to BST Conversion (See Details)
  1. Minimum Node in Binary Search Tree - Find min/max values in BST (C++ Solution)
  2. 109. Convert Sorted List to Binary Search Tree (LeetCode) - Medium (C++ Solution)

Day 111 View Code - 9 August, 2025

  • Binary Search Tree Operations with Test Cases (See Details)
  1. Inorder Predecessor and Successor (GeeksforGeeks) - Medium (C++ Solution)
  2. 450. Delete Node in a BST (LeetCode) - Medium (C++ Solution)
  3. 98. Validate Binary Search Tree (LeetCode) - Medium (C++ Solution)

Day 112 View Code - 10 August, 2025

  • Kth Element Problems in Binary Search Tree (See Details)
  1. Kth Largest Element in BST (GeeksForGeeks) - Medium (C++ Solution)
  2. 230. Kth Smallest Element in a BST (LeetCode) - Medium (C++ Solution)

Day 113 View Code - 11 August, 2025

  • Binary Search Tree Problems with Morris Traversal (See Details)
  1. 938. Range Sum of BST (LeetCode) - Easy (C++ Solution)
  2. 235. Lowest Common Ancestor of a Binary Search Tree (LeetCode) - Easy (C++ Solution)
  3. 653. Two Sum IV - Input is a BST (LeetCode) - Easy (C++ Solution)

Day 114 View Code - 12 August, 2025

  1. 1382. Balance a Binary Search Tree (LeetCode) - Medium (C++ Solution)
  2. Flatten BST to Sorted List (GeeksForGeeks) - Medium (C++ Solution)

Day 115 View Code - 13 August, 2025

  1. 1008. Construct Binary Search Tree from Preorder Traversal (LeetCode) - Medium (C++ Solution)

Day 116 View Code - 14 August, 2025

  1. 99. Recover Binary Search Tree (LeetCode) - Medium (C++ Solution)
  2. 108. Convert Sorted Array to Binary Search Tree (LeetCode) - Easy (C++ Solution)
  3. 111. Minimum Depth of Binary Tree (LeetCode) - Easy (C++ Solution)

Day 117 View Code - 15 August, 2025

  1. 287. Find the Duplicate Number (LeetCode) - Medium (C++ Solution)

Day 118 View Code - 19 August, 2025

  1. Largest BST in a Binary Tree (GeeksforGeeks) - Medium (C++ Solution)
  2. Merge Two BSTs (GeeksforGeeks) - Medium (C++ Solution)
  3. 1373. Maximum Sum BST in Binary Tree (LeetCode) - Hard (C++ Solution)

<---------- HEAP ----------->

Day 119 View Code - 20 August, 2025

  1. Heap Implementation (C++ Solution)

Day 120 View Code - 21 August, 2025

Day 121 View Code - 22 August, 2025

Day 122 View Code - 23 August, 2025

  1. 958. Check Completeness of a Binary Tree (LeetCode) - Medium (C++ Solution)
  2. Is Binary Tree Heap (GeeksForGeeks) - Medium (C++ Solution)
  3. Merge Two Max Heaps (GeeksForGeeks) - Medium (C++ Solution)
  4. Minimum Cost of Ropes (GeeksForGeeks) - Medium (C++ Solution)
  5. BST to Max Heap (GeeksForGeeks) - Medium (C++ Solution)
  6. 617. Merge Two Binary Trees (LeetCode) - Easy (C++ Solution)

Day 123 View Code - 24 August, 2025

  1. 53. Maximum Subarray (LeetCode) - Medium (C++ Solution)
  2. K-th Largest Sum Contiguous Subarray (GeeksForGeeks) - Medium (C++ Solution)
  3. 23. Merge k Sorted Lists (LeetCode) - Hard (C++ Solution)

Day 124 View Code - 25 August, 2025

  1. 632. Smallest Range Covering Elements from K Lists (LeetCode) - Hard (C++ Solution)
  2. 295. Find Median from Data Stream (LeetCode) - Hard (C++ Solution)

Day 125 View Code - 26 August, 2025

<--------HASHMAP--------->

  1. Hashmap Implementation - Basic operations and implementation details
  2. Hash Table Internals - Detailed explanation of hash table internal workings
  3. 3005. Count Elements With Maximum Frequency (LeetCode) - Easy (C++ Solution)

Day 126 View Code - 27 August, 2025

<--------TRIE--------->

  1. Trie Implementation - Complete implementation with insert, search, and delete operations
  2. 208. Implement Trie (Prefix Tree) (LeetCode) - Medium (C++ Solution)

Day 127 View Code - 28 August, 2025

  1. 14. Longest Common Prefix (LeetCode) - Easy (C++ Solution)

Day 128 View Code - 30 August, 2025

  1. 1268. Search Suggestions System (LeetCode) - Medium (C++ Solution)
  2. 2185. Counting Words With a Given Prefix (LeetCode) - Easy (C++ Solution)
  3. 2255. Count Prefixes of a Given String (LeetCode) - Easy (C++ Solution)

<---------- BACKTRACKING -------------->

Day 129 View Code - 31 August, 2025

  • Backtracking Problems
  1. 51. N-Queens (LeetCode) - Hard (C++ Solution)
  2. Rat in a Maze Problem (GeeksForGeeks) - Medium (C++ Solution)

Day 130 View Code - 1 September, 2025

  • Sudoku Problems
  1. 36. Valid Sudoku (LeetCode) - Medium (C++ Solution)
  2. 37. Sudoku Solver (LeetCode) - Hard (C++ Solution)

Day 131 View Code - 2 September, 2025

<--------- GRAPH ------------->

  1. Graph Implementation - Basic graph implementation using adjacency list
  2. Print Adjacency List (Coding Ninjas) - Easy (C++ Solution)

Day 132 View Code - 4 September, 2025

  • Graph Traversal Algorithms
  1. BFS Traversal - Implementation of Breadth-First Search for both connected and disconnected graphs
  2. BFS of Graph (GeeksForGeeks) - Medium (C++ Solution)
  3. DFS of Graph (GeeksForGeeks) - Medium (C++ Solution)

Day 133 View Code - 5 September, 2025

  • Graph Cycle Detection
  1. Detect Cycle in an Undirected Graph (GeeksForGeeks) - Medium (C++ Solution)

Day 134 View Code - 6 September, 2025

  • Directed Graph Cycle Detection
  1. Detect Cycle in a Directed Graph (GeeksForGeeks) - Medium (C++ Solution)
  2. 2360. Longest Cycle in a Graph (LeetCode) - Hard (C++ Solution)

Day 135 View Code - 7 September, 2025

  • Topological Sort
  1. Topological Sort (GeeksForGeeks) - Medium (C++ Solution)
  2. Cycle Detection in Directed Graph using Kahn's Algorithm (GeeksForGeeks) - Medium (C++ Solution)

Day 136 View Code - 8 September, 2025

  • Shortest Path Algorithms
  1. Shortest Path in an Unweighted Undirected Graph (Naukri Code360) - Medium (C++ Solution)

Day 137 View Code - 9 September, 2025

  • Path Finding in Directed Acyclic Graphs
  1. 797. All Paths From Source to Target (LeetCode) - Medium (C++ Solution)

Day 138 View Code - 10 September, 2025

  • Shortest Paths in Weighted Directed Acyclic Graphs
  1. Shortest Path in Directed Acyclic Graph (GeeksforGeeks) - Medium (C++ Solution)

Day 139 View Code - 13 September, 2025

  • Dijkstra's Algorithm for Shortest Path in Weighted Graphs
  1. 743. Network Delay Time (LeetCode) - Medium (C++ Solution)

Day 140 View Code - 14 September, 2025

  1. Minimum Spanning Tree (GeeksforGeeks) - Medium (C++ Solution)

Day 141 View Code - 15 September, 2025

  1. Minimum Spanning Tree (Kruskal's Algorithm) (GeeksforGeeks) - Medium (C++ Solution)

Day 142 View Code - 16 September, 2025

  1. 1584. Min Cost to Connect All Points (LeetCode) - Medium (C++ Solution)
  2. 1192. Critical Connections in a Network (LeetCode) - Hard (C++ Solution)

Feel free to explore my solutions and learning journey! 💻

Releases

No releases published

Packages

 
 
 

Contributors

Languages