sobhanbera / algorithms

Dive into algorithms, data structures, and competitive programming solutions in multiple languages. Active since Hacktoberfest 2020!
https://github.com/sobhanbera
MIT License
28 stars 85 forks source link
algorithms cpp golang hacktoberfest java javascript python rust typescript

HACKTOBERFEST 2023

image

Star The Repository if it helped you in any direction.

Algorithms and Data-Structures.

This is a repository to get Algorithms and data-structures in many languages.

Everybody is welcomed to contribute to this repo.

Overview

The goal of this project is to help the beginners with their contributions in Open Source. We aim to achieve this collaboratively, so feel free to contribute in any way you want, just make sure to follow the contribution guidelines. You can contribute to it in either of the following ways: You can choose at least any one option below or can add any algorithm or data-structure you like:

Implementations โš™

Quick Start ๐ŸŒŸ

What is Hacktoberfest?

Hacktoberfest is a month long virtual festival event to celebrate open source contributions presented by Digital Ocean and DEV. It is the easiest way to get into open source!

During the entire month of October 2023, all you have to do is contribute to any open source projects and open at least 4 pull requests. Yes, any project and any kind of contributions.

Why Should I Contribute?

The Hacktoberfestโ€™s simple plain objective is: Support open source and earn a limited edition T-shirt! But, itโ€™s not just about the t-shirts or stickers. Its about supporting open source. Its about celebrating open source, and giving it back. If youโ€™ve never contributed to open source before, this is the perfect time to get started because Hacktoberfest provides a large list of available contribution opportunities.

What Can I Contribute?

Hacktoberfestยฎ is open to everyone in our global community. Whether youโ€™re a developer, student learning to code. You can contribute to anything from code to simple fix, new feature to grammar mistake.

How to Contribute in this repo.

Contributing to open-source is easy.

Click here for more explanation

What if my pull requests arenโ€™t accepted?

The only exception would be if the project maintainer chooses to mark your pull request as โ€œinvalidโ€. Even if your pull requests arenโ€™t accepted, they should still count toward your 4 pull requests necessary to earn the shirt.

What kinds of pull requests count toward earning the Hacktoberfest shirt?

Any pull request made to a public repo on GitHub will count. The pull request must contain commits you personally made yourself โ€” not automated commits from bots.

You can contribute to any open source project hosted on Github.com and contribute anything between October 1 to October 31 midnight in 2023. You will find plenty of issues labeled with hacktoberfest or good-first-issue etc on Github. These will be the simple ones most probably and easy to fix.


Directory Tree ๐Ÿ‘‡๐Ÿป

Directory Tree ``` . โ”œโ”€โ”€ CODE_OF_CONDUCT.md โ”œโ”€โ”€ LICENSE โ”œโ”€โ”€ README.md โ”œโ”€โ”€ algorithms โ”‚ โ”œโ”€โ”€ c-sharp โ”‚ โ”‚ โ””โ”€โ”€ algorithmsInfo.md โ”‚ โ”œโ”€โ”€ cpp โ”‚ โ”‚ โ”œโ”€โ”€ algorithmsInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ bfs.cpp โ”‚ โ”‚ โ”œโ”€โ”€ bfs_modified.cpp โ”‚ โ”‚ โ”œโ”€โ”€ binary_search.cpp โ”‚ โ”‚ โ”œโ”€โ”€ bogo_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ bubble_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ dft.cpp โ”‚ โ”‚ โ”œโ”€โ”€ dijkstra's_algorithm.cpp โ”‚ โ”‚ โ”œโ”€โ”€ heap_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ insertion_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ kadane's_algorithm.cpp โ”‚ โ”‚ โ”œโ”€โ”€ krushkal's_minimum_spanning_tree.cpp โ”‚ โ”‚ โ”œโ”€โ”€ linear_search.cpp โ”‚ โ”‚ โ”œโ”€โ”€ longest_increasing_subsequence.cpp โ”‚ โ”‚ โ”œโ”€โ”€ longest_palindrome_substring.cpp โ”‚ โ”‚ โ”œโ”€โ”€ max_xor_pair_trie.cpp โ”‚ โ”‚ โ”œโ”€โ”€ merge_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ next_greater_in_o(n).cpp โ”‚ โ”‚ โ”œโ”€โ”€ quick_sort.cpp โ”‚ โ”‚ โ”œโ”€โ”€ selection_sort.cpp โ”‚ โ”‚ โ””โ”€โ”€ sieve_of_eratosthenes.cpp โ”‚ โ”œโ”€โ”€ haskell โ”‚ โ”‚ โ””โ”€โ”€ maths โ”‚ โ”‚ โ””โ”€โ”€ fibonacci.hs โ”‚ โ”œโ”€โ”€ java โ”‚ โ”‚ โ”œโ”€โ”€ algorithmsInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ amstrong.java โ”‚ โ”‚ โ”œโ”€โ”€ binary_search.java โ”‚ โ”‚ โ”œโ”€โ”€ breadth_first_search.java โ”‚ โ”‚ โ”œโ”€โ”€ bst โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ bst.java โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ bst_node.java โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ bstree.java โ”‚ โ”‚ โ”œโ”€โ”€ bubble_sort.java โ”‚ โ”‚ โ”œโ”€โ”€ counting_sort.java โ”‚ โ”‚ โ”œโ”€โ”€ dfs.java โ”‚ โ”‚ โ”œโ”€โ”€ dijkstra's_algorithm.java โ”‚ โ”‚ โ”œโ”€โ”€ factorial.java โ”‚ โ”‚ โ”œโ”€โ”€ huffman_coding.java โ”‚ โ”‚ โ”œโ”€โ”€ insertion_sort.java โ”‚ โ”‚ โ”œโ”€โ”€ interpolation_sort.java โ”‚ โ”‚ โ”œโ”€โ”€ kadane's_algorithm.java โ”‚ โ”‚ โ”œโ”€โ”€ krushkal's_algorithm.java โ”‚ โ”‚ โ””โ”€โ”€ quick_sort.java โ”‚ โ”œโ”€โ”€ javascript โ”‚ โ”‚ โ”œโ”€โ”€ algorithmsInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ bubble_sort.js โ”‚ โ”‚ โ”œโ”€โ”€ bubble_sort_visualized.js โ”‚ โ”‚ โ”œโ”€โ”€ counting_sort.js โ”‚ โ”‚ โ””โ”€โ”€ linear_search.js โ”‚ โ”œโ”€โ”€ other โ”‚ โ”‚ โ”œโ”€โ”€ algorithmsInfo.md โ”‚ โ”‚ โ””โ”€โ”€ typescript โ”‚ โ”‚ โ”œโ”€โ”€ bogo_sort.ts โ”‚ โ”‚ โ”œโ”€โ”€ counting_sort.ts โ”‚ โ”‚ โ””โ”€โ”€ merge_sort.ts โ”‚ โ””โ”€โ”€ python โ”‚ โ”œโ”€โ”€ algorithmsInfo.md โ”‚ โ”œโ”€โ”€ binary_search.py โ”‚ โ”œโ”€โ”€ bogo_sort.py โ”‚ โ”œโ”€โ”€ breadth_first_search.py โ”‚ โ”œโ”€โ”€ bubble_sort.py โ”‚ โ”œโ”€โ”€ dijkstra's_algorithm.py โ”‚ โ”œโ”€โ”€ heap_sort.py โ”‚ โ”œโ”€โ”€ insertion_sort.py โ”‚ โ”œโ”€โ”€ kadane's_algorithm.py โ”‚ โ”œโ”€โ”€ krushal's_minimum_spanning_tree.py โ”‚ โ”œโ”€โ”€ linear_search.py โ”‚ โ”œโ”€โ”€ merge_sort.py โ”‚ โ””โ”€โ”€ quick_sort.py โ”œโ”€โ”€ data structures โ”‚ โ”œโ”€โ”€ c-sharp โ”‚ โ”‚ โ””โ”€โ”€ dsInfo.md โ”‚ โ”œโ”€โ”€ cpp โ”‚ โ”‚ โ”œโ”€โ”€ bst.cpp โ”‚ โ”‚ โ”œโ”€โ”€ doubly_linked_list.cpp โ”‚ โ”‚ โ”œโ”€โ”€ dsInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ heap.cpp โ”‚ โ”‚ โ”œโ”€โ”€ linkedlist.cpp โ”‚ โ”‚ โ”œโ”€โ”€ trie.cpp โ”‚ โ”‚ โ””โ”€โ”€ union_find_disjoint_sets.cpp โ”‚ โ”œโ”€โ”€ java โ”‚ โ”‚ โ”œโ”€โ”€ bst.java โ”‚ โ”‚ โ”œโ”€โ”€ dsInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ dynamic_list.java โ”‚ โ”‚ โ””โ”€โ”€ queue_using_stack.java โ”‚ โ”œโ”€โ”€ javascript โ”‚ โ”‚ โ”œโ”€โ”€ bst.js โ”‚ โ”‚ โ””โ”€โ”€ dsInfo.md โ”‚ โ”œโ”€โ”€ other โ”‚ โ”‚ โ””โ”€โ”€ dsInfo.md โ”‚ โ””โ”€โ”€ python โ”‚ โ””โ”€โ”€ dsInfo.md โ”œโ”€โ”€ docs โ”‚ โ””โ”€โ”€ CONTRIBUTING.md โ”œโ”€โ”€ hacktoberfest.gif โ”œโ”€โ”€ hacktoberfest2020.svg โ”œโ”€โ”€ others โ”‚ โ”œโ”€โ”€ hang_man_sy.py โ”‚ โ”œโ”€โ”€ pythonSMTP_Skeleton.py โ”‚ โ””โ”€โ”€ snake_game.py โ”œโ”€โ”€ questions โ”‚ โ”œโ”€โ”€ c-sharp โ”‚ โ”‚ โ””โ”€โ”€ queInfo.md โ”‚ โ”œโ”€โ”€ cpp โ”‚ โ”‚ โ”œโ”€โ”€ all_sol_of_n_queen.cpp โ”‚ โ”‚ โ”œโ”€โ”€ edit_distance.cpp โ”‚ โ”‚ โ”œโ”€โ”€ knapsack.cpp โ”‚ โ”‚ โ”œโ”€โ”€ knapsack_with_large_weight.cpp โ”‚ โ”‚ โ”œโ”€โ”€ knight_tour_backtracking.cpp โ”‚ โ”‚ โ”œโ”€โ”€ matrix_chain_mult.cpp โ”‚ โ”‚ โ”œโ”€โ”€ n_queen.cpp โ”‚ โ”‚ โ”œโ”€โ”€ queInfo.md โ”‚ โ”‚ โ”œโ”€โ”€ rod_cutting_prob.cpp โ”‚ โ”‚ โ”œโ”€โ”€ sub_matrix_with_all_1s.cpp โ”‚ โ”‚ โ””โ”€โ”€ two_sum.cpp โ”‚ โ”œโ”€โ”€ java โ”‚ โ”‚ โ”œโ”€โ”€ coin_change.java โ”‚ โ”‚ โ””โ”€โ”€ queInfo.md โ”‚ โ”œโ”€โ”€ javascript โ”‚ โ”‚ โ””โ”€โ”€ queInfo.md โ”‚ โ”œโ”€โ”€ other โ”‚ โ”‚ โ””โ”€โ”€ queInfo.md โ”‚ โ””โ”€โ”€ python โ”‚ โ”œโ”€โ”€ coin_change1.py โ”‚ โ”œโ”€โ”€ coin_change2.py โ”‚ โ”œโ”€โ”€ egg_dropping.py โ”‚ โ”œโ”€โ”€ queInfo.md โ”‚ โ””โ”€โ”€ subset.py โ””โ”€โ”€ templates โ”œโ”€โ”€ cpp โ”‚ โ””โ”€โ”€ templateHelp.md โ”œโ”€โ”€ java โ”‚ โ””โ”€โ”€ templateHelp.md โ”œโ”€โ”€ other โ”‚ โ””โ”€โ”€ templateHelp.md โ”œโ”€โ”€ python โ”‚ โ””โ”€โ”€ templateHelp.md โ””โ”€โ”€ templateHelp.md ```

Implemented Algorithms

Algorithm C CPP Java Python JavaScript Golang C# Rust Other
Binary Search :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: TS, KT
Bogo Sort :white_check_mark: :white_check_mark: TS
Breadth First Search :white_check_mark: :white_check_mark: :white_check_mark:
Breadth First Traversal :white_check_mark:
Bubble sort :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Counting Sort :white_check_mark: :white_check_mark: TS
Depth First Search :white_check_mark:
Depth First Traversal :white_check_mark:
Dijkstra Algorithm :white_check_mark: :white_check_mark: :white_check_mark:
Finite Automata
Heap Sort :white_check_mark: :white_check_mark:
Huffman Coding :white_check_mark:
Insertion Sort :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Interpolation Search :white_check_mark:
K-NN
K Centers Problem
Kadane's Algorithms :white_check_mark: :white_check_mark: :white_check_mark:
KMP Algorithm
Kruskalโ€™s Minimum Spanning Tree Algorithm :white_check_mark: :white_check_mark: :white_check_mark:
Linear Search :white_check_mark: :white_check_mark: :white_check_mark:
Longest Common Subsequence
Longest Increasing Subsequence :white_check_mark:
Longest Palindromic Substring :white_check_mark:
Merge Sort :white_check_mark: :white_check_mark: :white_check_mark: TS
Naive Search
Quick Sort :white_check_mark: :white_check_mark: :white_check_mark:
Radix Sort
Selection Sort :white_check_mark: :white_check_mark:
Sieve of Eratosthenes :white_check_mark:
Suffix Array
Shell Sort :white_check_mark:

Some CP Question

Questions CPP Java Python JavaScript Golang C# Other
Binomial Coefficient
Bellmanโ€“Ford Algorithm
Coin Change :white_check_mark:
Count ways to reach the nโ€™th stair
Cutting a Rod
Edit Distance :white_check_mark:
Egg Droping Puzzle :white_check_mark:
Knapsack Problem :white_check_mark:
Largest Sum Contiguous Subarray
m Coloring Problem
Pascalโ€™s Triangle
Matrix Chain Multiplication :white_check_mark:
Maximum sum rectangle in a 2D matrix
Min Cost Path
Rod Cutting :white_check_mark:
Partition problem
Subset Sum :white_check_mark:
Tiling Problem
The Knightโ€™s tour problem
Three Sum
Two Sum :white_check_mark: :white_check_mark:
Variations of LIS
Word Wrap Problem

Data Structures Implementations.

Data Structure CPP Java Python JavaScript Golang C# Other
AVL Tree
Binary Search Tree :white_check_mark: :white_check_mark: :white_check_mark:
Binary Tree
Doubly Linked List :white_check_mark:
Graph
Heap :white_check_mark:
Linked List :white_check_mark:
Queue :white_check_mark: :white_check_mark:
Stack
Trie :white_check_mark:
DSU :white_check_mark:

you can add more algorithms, data-structure and cp problems if you like to in the readme file, after you have been assigned to any issue

How to run them ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

Language Steps
C++
g++ 
./a.out # unix
a.exe # windows
Java
javac 
java
Python
python 
JavaScript
node 
Golang
go run 
C#
mcs 
mono