Skip to content

Welcome to my Data Structures and Algorithms (DSA) repository! This repository is dedicated to my journey of mastering data structures and algorithms. Here, you'll find solutions to various problems I've tackled as part of my learning process.

Notifications You must be signed in to change notification settings

nikhilmehlan/Dsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms Journey

Welcome to my Data Structures and Algorithms (DSA) repository! This repository is a personal project where I document and solve various problems related to data structures and algorithms. It's a reflection of my journey in mastering these fundamental concepts and enhancing my problem-solving skills.

Leetcode Stats

📚 Repository Contents

  • Problems: A collection of solved problems categorized by data structures and algorithms.
  • Solutions: Implementations in multiple programming languages (e.g., C++, Python, Java).
  • Explanations: Detailed explanations and comments for each solution to aid understanding.
  • Challenges: A selection of challenging problems to push my limits and improve my skills.

🛠️ How to Use

  1. Explore: Browse through the different directories and files to find problems and their solutions.
  2. Run: Follow the instructions in each problem’s directory to run the code. You may need to install dependencies if required.
  3. Learn: Review the code and explanations to understand the problem-solving approach and algorithmic concepts.
  4. Contribute: If you have suggestions for improvements or additional problems, feel free to open an issue or submit a pull request.

📝 Topics Covered

  • Arrays
  • Linked Lists
  • Stacks
  • Queues
  • Trees (Binary Trees, Binary Search Trees, AVL Trees)
  • Graphs (DFS, BFS, Shortest Path Algorithms)
  • Dynamic Programming
  • Hashing
  • Sorting and Searching Algorithms
  • And more...

📈 My Progress

This repository is continually updated as I work through more problems and refine my solutions. Check out the commit history to see my progress and updates.

🚀 Getting Started

To get started with this repository:

  1. Clone the repository:
    git clone https://github.com/yourusername/your-repo-name.git
  2. Navigate to the problem's directory and follow the instructions provided in the respective README files for each problem.
  3. Run the provided code and review the results.

📫 Contact

For any questions or feedback, feel free to contact me via [email protected] or open an issue on GitHub.


Happy coding!

LeetCode Topics

Array

0035-search-insert-position
0037-sudoku-solver
0042-trapping-rain-water
0045-jump-game-ii
0051-n-queens
0055-jump-game
0056-merge-intervals
0057-insert-interval
0078-subsets
0079-word-search
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0090-subsets-ii
0135-candy
0136-single-number
0139-word-break
0204-count-primes
0215-kth-largest-element-in-an-array
0239-sliding-window-maximum
0347-top-k-frequent-elements
0407-trapping-rain-water-ii
0435-non-overlapping-intervals
0455-assign-cookies
0496-next-greater-element-i
0503-next-greater-element-ii
0621-task-scheduler
0735-asteroid-collision
0792-binary-search
0876-hand-of-straights
0890-lemonade-change
0940-fruit-into-baskets
0943-sum-of-subarray-minimums
0966-binary-subarrays-with-sum
1034-subarrays-with-k-different-integers
1046-max-consecutive-ones-iii
1370-count-number-of-nice-subarrays
1538-maximum-points-you-can-obtain-from-cards
2145-grid-game
2227-sum-of-subarray-ranges
2533-bitwise-xor-of-all-pairings
2685-first-completely-painted-row-or-column
2792-neighboring-bitwise-xor

String

0003-longest-substring-without-repeating-characters
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0076-minimum-window-substring
0079-word-search
0131-palindrome-partitioning
0139-word-break
0282-expression-add-operators
0402-remove-k-digits
0424-longest-repeating-character-replacement
0678-valid-parenthesis-string
1460-number-of-substrings-containing-all-three-characters

Backtracking

0017-letter-combinations-of-a-phone-number
0037-sudoku-solver
0051-n-queens
0078-subsets
0079-word-search
0090-subsets-ii
0131-palindrome-partitioning
0282-expression-add-operators

Matrix

0037-sudoku-solver
0079-word-search
0085-maximal-rectangle
0407-trapping-rain-water-ii
2145-grid-game
2685-first-completely-painted-row-or-column

Bit Manipulation

0029-divide-two-integers
0078-subsets
0090-subsets-ii
0136-single-number
0231-power-of-two
2323-minimum-bit-flips-to-convert-number
2533-bitwise-xor-of-all-pairings
2792-neighboring-bitwise-xor

Hash Table

0003-longest-substring-without-repeating-characters
0017-letter-combinations-of-a-phone-number
0037-sudoku-solver
0076-minimum-window-substring
0139-word-break
0146-lru-cache
0347-top-k-frequent-elements
0355-design-twitter
0424-longest-repeating-character-replacement
0460-lfu-cache
0496-next-greater-element-i
0621-task-scheduler
0876-hand-of-straights
0940-fruit-into-baskets
0966-binary-subarrays-with-sum
1034-subarrays-with-k-different-integers
1370-count-number-of-nice-subarrays
1460-number-of-substrings-containing-all-three-characters
2685-first-completely-painted-row-or-column

Dynamic Programming

0042-trapping-rain-water
0045-jump-game-ii
0055-jump-game
0085-maximal-rectangle
0131-palindrome-partitioning
0139-word-break
0435-non-overlapping-intervals
0678-valid-parenthesis-string
0943-sum-of-subarray-minimums

Trie

0139-word-break

Memoization

0139-word-break

Math

0029-divide-two-integers
0050-powx-n
0204-count-primes
0231-power-of-two
0282-expression-add-operators
1370-count-number-of-nice-subarrays

Recursion

0050-powx-n
0231-power-of-two

Binary Search

0035-search-insert-position
0792-binary-search
1046-max-consecutive-ones-iii

Enumeration

0204-count-primes

Number Theory

0204-count-primes

Brainteaser

2533-bitwise-xor-of-all-pairings

Stack

0020-valid-parentheses
0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0155-min-stack
0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0678-valid-parenthesis-string
0735-asteroid-collision
0937-online-stock-span
0943-sum-of-subarray-minimums
2227-sum-of-subarray-ranges

Design

0146-lru-cache
0155-min-stack
0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0295-find-median-from-data-stream
0355-design-twitter
0460-lfu-cache
0789-kth-largest-element-in-a-stream
0937-online-stock-span

Queue

0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0239-sliding-window-maximum

Monotonic Stack

0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0937-online-stock-span
0943-sum-of-subarray-minimums
2227-sum-of-subarray-ranges

Two Pointers

0042-trapping-rain-water
0295-find-median-from-data-stream
0455-assign-cookies

Breadth-First Search

0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0407-trapping-rain-water-ii

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0239-sliding-window-maximum
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0355-design-twitter
0407-trapping-rain-water-ii
0621-task-scheduler
0789-kth-largest-element-in-a-stream

Simulation

0735-asteroid-collision

Greedy

0045-jump-game-ii
0055-jump-game
0135-candy
0402-remove-k-digits
0435-non-overlapping-intervals
0455-assign-cookies
0621-task-scheduler
0678-valid-parenthesis-string
0876-hand-of-straights
0890-lemonade-change

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0239-sliding-window-maximum
0424-longest-repeating-character-replacement
0940-fruit-into-baskets
0966-binary-subarrays-with-sum
1034-subarrays-with-k-different-integers
1046-max-consecutive-ones-iii
1370-count-number-of-nice-subarrays
1460-number-of-substrings-containing-all-three-characters
1538-maximum-points-you-can-obtain-from-cards

Monotonic Queue

0239-sliding-window-maximum

Data Stream

0295-find-median-from-data-stream
0789-kth-largest-element-in-a-stream
0937-online-stock-span

Linked List

0023-merge-k-sorted-lists
0146-lru-cache
0355-design-twitter
0460-lfu-cache

Doubly-Linked List

0146-lru-cache
0460-lfu-cache

Prefix Sum

0966-binary-subarrays-with-sum
1046-max-consecutive-ones-iii
1370-count-number-of-nice-subarrays
1538-maximum-points-you-can-obtain-from-cards
2145-grid-game

Counting

0347-top-k-frequent-elements
0621-task-scheduler
1034-subarrays-with-k-different-integers

Divide and Conquer

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Sorting

0056-merge-intervals
0215-kth-largest-element-in-an-array
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0435-non-overlapping-intervals
0455-assign-cookies
0621-task-scheduler
0876-hand-of-straights

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Merge Sort

0023-merge-k-sorted-lists

Tree

0094-binary-tree-inorder-traversal
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0543-diameter-of-binary-tree
0789-kth-largest-element-in-a-stream

Binary Search Tree

0789-kth-largest-element-in-a-stream

Binary Tree

0094-binary-tree-inorder-traversal
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0543-diameter-of-binary-tree
0789-kth-largest-element-in-a-stream

Bucket Sort

0347-top-k-frequent-elements

Depth-First Search

0094-binary-tree-inorder-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0543-diameter-of-binary-tree

About

Welcome to my Data Structures and Algorithms (DSA) repository! This repository is dedicated to my journey of mastering data structures and algorithms. Here, you'll find solutions to various problems I've tackled as part of my learning process.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published