manan025 / ds-algo-zone Goto Github PK
View Code? Open in Web Editor NEWThis repository contains codes for various data structures and algorithms in C, C++, Java, Python, C#, Go, JavaScript and Kotlin.
License: MIT License
This repository contains codes for various data structures and algorithms in C, C++, Java, Python, C#, Go, JavaScript and Kotlin.
License: MIT License
Find the Minimum Spanning Tree using Kruskal's algorithm
Yes
Kruskal's minimum spanning tree is used to find the minimum sum tree of an undirected graph, which has many practical uses (such as in maps)
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @CrapTheCoder
Go -
Java - @jfernancordova
Javascript -
Kotlin -
Python -
Level Order Traversal in Binary Search Tree (BST)
Yes
This is issued to solve many questions in competitive coding and is more efficient.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @saloni33
Go -
Java - @ishika22
Javascript -
Kotlin -
Python -
Tower of Hanoi Algo. Using Recursive and Non-Recursive 3 discs
(Write down a clear and concise description of what the feature is.)
(Yes.)
Since it is asked in a lot of interviews. It is important to know about it and I have codes working up to 3 disc.
Assign this to me for C.
C - @LikhithaTadikonda
C# -
C++ - @Mudit018
Go - @nakullondhe
Java - @jdrodriguezh
Javascript - @SurendarSingh
Kotlin -
Python - @TarushS
C - @LikhithaTadikonda
C# -
C++ - @Kshma29
Go -
Java - @Onkar627
Javascript -
Kotlin -
Python - @jAY1jS
Hey, I am participating in hacktoberfest, I world like to contribute Longest substring without repeating characters problem for string ,could you please assigned it to me.
Insertion In a Linked List
YES
Important Topic - Asked in many company's interviews
(Do not make changes in this section until asked to do so)
C - @nakullondhe
C# - @DoyelA
C++ - @saloni33
Go -
Java - @CC-KEH
Javascript -
Kotlin -
Python -
I would like to add an algorithm that implements K stacks in a single array
Yes
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @tm2k23
Go -
Java -
Javascript -
Kotlin -
Python -
Will check if the string is palindrome i.e. if the original string is the same as the string after reversing.
Yes
Basic algorithm
C - @anushkarthik05
C# - @mtwn105
C++ - @Anurag331
Go - @SOURAB-BAPPA
Java - @pabloescoder
Javascript - @Onkar627
Kotlin - @cb4d
Python - @ajaynair710
I would like to add all 3 traversals of the binary tree recursively
Yes
(Do not make changes in this section until asked to do so)
C - @Mudit018
C# -
C++ - @tm2k23
Go -
Java - @jfernancordova
Javascript - @prasanna16-12
Kotlin -
Python - @prakharshukla48
Tarjan's algorithm is used to find the single connected component in a directed graph.
YES
This is an efficient and advanced algorithm for finding SCC.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @Yash091
Go -
Java -
Javascript -
Kotlin -
Python -
Linear Search - search for the element matching each element in the array.
Yes
Basic Searching Algorithm
(Do not make changes in this section until asked to do so)
C - @shashank-suresh
C# -
C++ - @jagritvats
Go - @gopheramit
Java - @Jvs21
Javascript - @lokeshn011101
Kotlin - @NeerajKumar201
Python - @krishna16sharma
Given a 2D binary matrix A of dimensions NxM, determine the row that contains a minimum number of 1's.
Yes
It is one of the famous problem asked in Amazon interview, in which we need to find the row minimum number of 1s in a matrix
@AparnaJuhi - C++
@Anurag-Bhatt - Java
@mtwn105 - Javascript
@Rushijaviya - Python
@sumanthtatipamula - Kotlin
Implement Djikstra's Algorithm to find the single source shortest path in graph.
yes
Using set and unordered map and distance vector.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @vedant-jain03
Go -
Java - @jfernancordova
Javascript -
Kotlin -
Python - @yashikajotwani12
Insertion And Deletion of Node in Binary Search Tree
Yes
Because Binary search trees are implemented efficiently and operations like insertion, deletion are quite faster.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @saloni33
Go - @gopheramit
Java -
Javascript -
Kotlin -
Python -
Implementing 0/1 knapsack in cpp and analysing its complexities
Yes
DP plays an important role during CP. Therefore, adding it.
(Do not make changes in this section until asked to do so)
C - @Yash091
C# -
C++ - @AmbikeshArman
Go -
Java - @vinayakj592
Javascript -
Kotlin -
Python - @Aaryan8751
We need to place N chess queens on an NΓN chessboard so that no two queens attack each other.
Yes
This is a very common problem which uses the concept of backtracking. Initially we can mark a box as taken and if in further steps we find that the queen might be attacked, we can backtrack and remove our queen from that position.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @vedant-jain03
Go -
Java - @ishika22
Javascript -
Kotlin - @sgaurav37533
Python - @Abhiram-Joshi
Merge Sort - a popular sorting algorithm to sort arrays.
Yes
Basic Sorting Algorithm
(Do not make changes in this section until asked to do so)
C - @Yasas4D
C# -
C++ - @vinayakj592
Go - @parth93QA
Java - @Jvs21
Javascript - @Onkar627
Kotlin -
Python - @Yasas4D
Implement Bubble Sort. Do add Sample Input/Output, Time and Space Complexity at the bottom of the file (inside a comment).
Yes
A very basic and standard sorting algorithm.
@TarushS - Python
@SOURAB-BAPPA - C
@LalithyaManasaPatri - Java
@lokeshn011101 - Javascript
@shauryam-exe - Kotlin
@dvir019 - C#
Implement Binary Search taking array as input and finding a element taken as input.
Yes
One of the most used searching algorithm.
@Palak-2109 - C++
@Safwan310 - Java
@SOURAB-BAPPA - Go
@TarushS - Python
@mendoza - Javascript
@codenipun - Kotlin
@shashank-suresh - C
Union-Find Data Structure (also known as Disjoint Set Union) is a fast data structure to add, merge, or find a the head of a set.
Yes
UFDS can be used to find cycles, connected components, and many more.
Python - @CrapTheCoder
C++ - @jaisat
writing code for partition equal subset sum problem
Yes
Contributing to the DP portion
(Do not make changes in this section until asked to do so)
C - @Yash091
C# -
C++ - @Palak-2109
Go -
Java -
Javascript -
Kotlin -
Python - @ajaynair710
Find out the maximum amount of gold, miner can collect using DP. A gold mine of m*n dimensions is given, each element contains a positive integer which is the amount of gold. Initially miner starts from first column but, from any row. Then start moving towards the cell diagonally up right or right or diagonally down right.
Yes
This is a very popular question of DP, asked in many interviews. Please assign this task to me for JAVA.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @anushkarthik05
Go -
Java - @nikhil072000
Javascript -
Kotlin -
Python -
The java program find the row with least number of rows and print them along with their elements
YES
ISSUE #9 solved
Insertion Sort - an algorithm used to sort an array.
Yes
Basic Sorting Algorithm
(Do not make changes in this section until asked to do so)
C - @anushkarthik05
C# -
C++ - @jagritvats
Go - @gopheramit
Java - @Onkar627
Javascript - @jagritvats
Kotlin - @shauryam-exe
Python - @Rushijaviya
Shortest path from one node to another node in an unweighted graph using Breadth First Search.
Yes
Complexity of this algorithm: O(V+E)
Complexity of Dijkstra algorithm: O(V^2) when unoptimized, or O(V + E log V) when optimized using Priority Queue.
This algorithm is faster than the popular Dijkstra Algorithm, and is also far simpler, as it only uses a Breadth First Search.
Implement Kadaneβs Algorithm to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.
Yes
Uses O(1) space and takes O(n) time.
(Do not make changes in this section until asked to do so)
C - @anshkush92college
C# -
C++ - @tm2k23
Go -
Java - @Jvs21
Javascript -
Kotlin -
Python - @anushkarthik05
I would like to add morris traversal of binary trees which is done in O(1) space
Yes
=> No recursion
=> No stacks
=> O(1) Space
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @tm2k23
Go -
Java -
Javascript -
Kotlin -
Python -
Merge two sorted linked lists
Yes
Important and basic operation with linked list.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @Sakshi2020037
Go -
Java - @sachin4627
Javascript -
Kotlin -
Python -
DNF sort
yes
3 random number can be sorted in linear time that does not consume any extra space
(Do not make changes in this section until asked to do so)
C - @tm2k23
C# -
C++ - @SurendarSingh
Go -
Java -
Javascript -
Kotlin -
Python - @99anjali
A segment tree is a data structure used to store information about array segments and answer segment queries efficiently.
Yes
The important and advanced algorithm used in competitive programming.
(Do not make changes in this section until asked to do so)
C - @Mudit018
C# -
C++ - @saloni33
Go -
Java -
Javascript -
Kotlin -
Python -
Jump Search is a searching algorithm for sorted arrays. The basic idea is to check fewer elements (than linear search) by jumping ahead by fixed steps or skipping some elements in place of searching all elements.
YES
In Jump search, Instead of traversing the whole array one by one in linear fashion, we traverse the array by jumping ahead with fixed size steps to find the required element in less number of steps.It has an advantage in terms of Time complexity over Linear search.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @J-e-e-t
Go -
Java -
Javascript -
Kotlin -
Python -
Hey, I am Participating in hacktoberfest, I would like to contribute Kaden's algorithm, Could you please assigned it to me.
Thank you!
Implement stack in c using array and perform various stack operations.
Yes
One of the basic data structures when getting started with dsa
C - @KMayank02
C# -
C++ - @saiteja-2731
Go -
Java - @nithintata
Javascript - @prasanna16-12
Kotlin - @sumanthtatipamula
Python - @Rushijaviya
Topological Sorting is a linear ordering of vertices such that for every directed edge u v, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG.
YES
Topological Sorting is advanced algorithm mainly used for scheduling jobs from the given dependencies among jobs
(Do not make changes in this section until asked to do so)
C - @arihantthriwe
C# - @codesanta142
C++ - @Yash091
Go -
Java -
Javascript -
Kotlin -
Python -
Selection Sort - an algorithm used to sort an array.
Yes
Basic Sorting Algorithm
(Do not make changes in this section until asked to do so)
C - @omjasharma
C# -
C++ - @Sahilnegi-code
Go - @gopheramit
Java - @Jvs21
Javascript - @pabloescoder
Kotlin -
Python - @SOURAB-BAPPA
Sorting algorithm - QuickSort
Yes
Standard sorting algorithm
(Do not make changes in this section until asked to do so)
C - @JatinKumarMahaldar
C# - @Sachin-Liyanage
C++ - @wimanshaherath
Go - @gopheramit
Java - @vinayakj592
Javascript - @Athi223
Kotlin - @sumanthtatipamula
Python - @tejasanand
Sieve of eratosthenes is the algorithm to find all the prime numbers less than or equal to a given integer n.
Yes
Many companies focus on more advanced algorithms and sieve of eratosthenes is used frequently in many questions and is also an advanced algorithm.
(Do not make changes in this section until asked to do so)
C - @gaurav1058
C# - @Osama-aj
C++ - @Yash091
Go - @lucblassel
Java - @sachin4627
Javascript -
Kotlin -
Python - @Noxbolt
DFS and BFS traversal in an Undirected Graph
YES
Since it is the backbone of graph theory, so it would be extremely important to include this file
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @Mudit018
Go -
Java -
Javascript -
Kotlin -
Python -
Maximum Sum Increasing Subsequence (Dp)
Yes
Implementing this by using Dynamic Programming Approach
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @yashikajotwani12
Go -
Java - @LalithyaManasaPatri
Javascript -
Kotlin -
Python - @vedant-jain03
We will be printing a binary tree in vertical order.
Input:
Output: 4,2,1,5,3,6
Explanation:
As we can see there are 5 vertical lines which can pass through the tree -
1st vertical line - 4
2nd vertical line - 2
3rd vertical line - 1,5
4th vertical line - 3
5th vertical line - 6
Yes
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @tm2k23
Go -
Java - @ishika22
Javascript -
Kotlin - @sumanthtatipamula
Python - @prakharshukla48
the graph such that we can divide the graph into 2 different subset or we can color every node of the graph such that two adjacent node should not have same color.
Yes
using dfs and unordered map
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @vedant-jain03
Go -
Java -
Javascript -
Kotlin -
Python -
Fibonacci series -> Every element is the sum of the previous 2 elements and the first 2 elements are 0 and 1 respectively.
Yes
Brute force algorithm
(Do not make changes in this section until asked to do so)
C - @JatinKumarMahaldar
C# - @DoyelA
C++ - @tm2k23
Go - @gopheramit
Java - @SUDHANSHKESHARWANI
Javascript - @ADV1K
Kotlin - @Diegoslourenco
Python - @Noxbolt
Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Example 3:
Input: s = "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
Example 4:
Input: s = ""
Output: 0
yes
@SOURAB-BAPPA - Python
@saiteja-2731 - C++
@siddharthgangwar25 - C
@nithintata - Java
@Devenkapoor7303 - Javascript
@CarleenSinton - C#
DFS and BFS traversal in a 2d grid
YES
As DFS and BFS are the backbones of graphs and they are especially important in 2d grids.
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @Mudit018
Go -
Java - @jfernancordova
Javascript -
Kotlin -
Python -
This algorithm helps us to detect and remove cycles from a linked list
Yes
This can be obtained by using 2 nodes - fast and slow which can detect loops and also remove them if present
(Do not make changes in this section until asked to do so)
C -
C# -
C++ - @yashikajotwani12
Go -
Java - @ishika22
Javascript -
Kotlin -
Python - @vedant-jain03
Adding codes and explanation of unbounded knapsack using top down array-DP in cpp
yes
DP plays an important role during competitive programming. Thus, thought to add this one.
@Palak-2109 - C++
@lokeshn011101 - Javascript
@sudhir512kj - Python
Kaden's algorithm
Yes
.
(Do not make changes in this section until asked to do so)
C - @ravi0213
C# -
C++ - @yashikajotwani12
Go -
Java - @sachin4627
Javascript - @KajalBhalghare
Kotlin -
Python - @sudhir512kj
(Write down a clear and concise description of what the feature is.)
(Write your answer here.)
Yes , I read all the guidlines .
(Please explain why this feature should be implemented and how it would be used.)
It is the best way of finding the Greatest Common Divisor .
Euclid Algo -> According to this algorithm if b is smaller than a.
gcd(a,b) = gcd(a-b, b)
Let g be GCD of a and b
a = gx , b = gy and GCD(x,y) = 1
(a-b) = g(x-y)
(Do not make changes in this section until asked to do so)
C - @Ashutoshpandey-coder
C# -
C++ - @tm2k23
Go -
Java - @Ashutoshpandey-coder
Javascript -
Kotlin -
Python - @Noxbolt
Check if a singly linked list is palindrome
Yes
I would like to contribute the program for check if a singly linked list is palindrome in java, could you please assign it to me.
(Do not make changes in this section until asked to do so)
C -
C# - @Sachin-Liyanage
C++ - @yashikajotwani12
Go -
Java - @sachin4627
Javascript -
Kotlin -
Python - @sudhir512kj
Print n rows of Pascal's Triangle
Yes
(Do not make changes in this section until asked to do so)
C - @JatinKumarMahaldar
C# - @Osama-aj
C++ - @tm2k23
Go - @axlts
Java - @vinayakj592
Javascript - @jdrodriguezh
Kotlin -
Python - @Yasas4D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.