Skip to content

Latest commit

 

History

History
320 lines (290 loc) · 17.6 KB

README.md

File metadata and controls

320 lines (290 loc) · 17.6 KB

Algorithm Learning Repository

GitHub license

Welcome to my Algorithm Learning Repository! Here, I'm documenting and storing various algorithms that I'm learning and implementing in different programming languages. This repository serves as a resource for myself and others who want to explore and understand different algorithms.

Table of Contents

Introduction

In this repository, you will find a collection of algorithms covering a wide range of topics, including stl data structures, sorting, searching, and more. Each algorithm is implemented in one or more programming languages for educational purposes. You can use this repository to:

  • Learn and understand different algorithms.
  • Explore algorithm implementations in various programming languages.
  • Contribute your own implementations or improvements.

Algorithms

Here's a list of some of the algorithms I've covered so far:

  • Sorting Algorithms:

    • sort()
    • sort comparator function
  • Data Structures:

    • stack
    • queue
    • priority queue
    • array
  • Searching Algorithms:

    • Binary Search
    • Depth-First Search (DFS)
    • Breadth-First Search (BFS)
    • ...
  • Dynamic Programming:

    • Fibonacci Sequence
    • Knapsack Problem
    • knights problem
    • sudoku

This list is not exhaustive, and I'll continue to add more algorithms as I learn and implement them.

Languages

I've implemented these algorithms in various programming languages, including:

  • C++

Feel free to explore the code in your preferred language.

Usage

You can clone this repository to your local machine to explore the algorithms and their implementations. Each algorithm is contained within its own directory and includes a README.md file explaining the algorithm, its time complexity, and usage examples.

To clone the repository, use the following command:

git clone [https://github.com/iSparshP/Algorithms.git]

Contributing

Contributions are welcome! If you'd like to contribute to this repository, follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure they work as expected.
  4. Commit your changes and create a clear, concise pull request with a descriptive title.
  5. Explain the purpose and details of your changes in the pull request description.
  6. I'll review your contributions and merge them if they align with the repository's goals.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Happy learning and coding!

LeetCode Topics

Math

0002-add-two-numbers
0009-palindrome-number
0048-rotate-image
0070-climbing-stairs
0096-unique-binary-search-trees
0189-rotate-array
0204-count-primes
0279-perfect-squares
0371-sum-of-two-integers
1086-divisor-game
1236-n-th-tribonacci-number

Dynamic Programming

0053-maximum-subarray
0055-jump-game
0070-climbing-stairs
0096-unique-binary-search-trees
0121-best-time-to-buy-and-sell-stock
0198-house-robber
0279-perfect-squares
0300-longest-increasing-subsequence
0322-coin-change
0747-min-cost-climbing-stairs
1086-divisor-game
1111-minimum-score-triangulation-of-polygon
1236-n-th-tribonacci-number
1250-longest-common-subsequence

Memoization

0070-climbing-stairs
1236-n-th-tribonacci-number

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0162-find-peak-element
0300-longest-increasing-subsequence
0374-guess-number-higher-or-lower
2392-successful-pairs-of-spells-and-potions

Interactive

0374-guess-number-higher-or-lower

Array

0001-two-sum
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0046-permutations
0048-rotate-image
0053-maximum-subarray
0055-jump-game
0121-best-time-to-buy-and-sell-stock
0136-single-number
0162-find-peak-element
0169-majority-element
0179-largest-number
0189-rotate-array
0198-house-robber
0204-count-primes
0215-kth-largest-element-in-an-array
0300-longest-increasing-subsequence
0322-coin-change
0747-min-cost-climbing-stairs
1111-minimum-score-triangulation-of-polygon
2392-successful-pairs-of-spells-and-potions
2553-total-cost-to-hire-k-workers
2636-maximum-subsequence-score

Two Pointers

0189-rotate-array
2392-successful-pairs-of-spells-and-potions
2553-total-cost-to-hire-k-workers

Sorting

0169-majority-element
0179-largest-number
0215-kth-largest-element-in-an-array
0242-valid-anagram
2392-successful-pairs-of-spells-and-potions
2636-maximum-subsequence-score

Divide and Conquer

0053-maximum-subarray
0169-majority-element
0191-number-of-1-bits
0215-kth-largest-element-in-an-array

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
2413-smallest-number-in-infinite-set
2553-total-cost-to-hire-k-workers
2636-maximum-subsequence-score

Quickselect

0215-kth-largest-element-in-an-array

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0169-majority-element
0242-valid-anagram
2413-smallest-number-in-infinite-set

Design

2413-smallest-number-in-infinite-set

Greedy

0055-jump-game
0179-largest-number
2636-maximum-subsequence-score

Simulation

2553-total-cost-to-hire-k-workers

Database

0175-combine-two-tables
0197-rising-temperature
0601-human-traffic-of-stadium
1153-product-sales-analysis-i
1161-project-employees-i
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions

String

0003-longest-substring-without-repeating-characters
0179-largest-number
0242-valid-anagram
1250-longest-common-subsequence
2580-circular-sentence

Enumeration

0204-count-primes

Number Theory

0204-count-primes

Sliding Window

0003-longest-substring-without-repeating-characters

Matrix

0048-rotate-image

Bit Manipulation

0136-single-number
0191-number-of-1-bits
0371-sum-of-two-integers

Counting

0169-majority-element

Backtracking

0046-permutations
0077-combinations

Linked List

0002-add-two-numbers
0206-reverse-linked-list

Recursion

0002-add-two-numbers
0206-reverse-linked-list

Breadth-First Search

0279-perfect-squares
0322-coin-change
0547-number-of-provinces
0871-keys-and-rooms

Brainteaser

1086-divisor-game

Game Theory

1086-divisor-game

Tree

0096-unique-binary-search-trees

Binary Search Tree

0096-unique-binary-search-trees

Binary Tree

0096-unique-binary-search-trees

Depth-First Search

0547-number-of-provinces
0871-keys-and-rooms

Graph

0547-number-of-provinces
0871-keys-and-rooms

Union Find

0547-number-of-provinces