instagram

Algorithms

AlgorithmsDifficulty
Longest Increasing SubsequenceMedium
Minimum Number of Platforms Required for a Railway/Bus Station Method 1Easy
Job Sequencing Problem Find and UnionEasy
Job Sequencing ProblemEasy
Dijkstra’s shortest path algorithmMedium
Huffman CodingMedium
Prim’s Minimum Spanning Tree (MST)Medium
Kruskal’s Minimum Spanning Tree AlgorithmMedium
Find cycle/loop in the graph – Find and Union with Path CompressionEasy
Find cycle/loop in the graph – Find and UnionEasy
Algorithm to find exact square root in javaEasy
Given two binary strings, return their sum in binary stringEasy
Custom sorting algorithm using java collection classesEasy
Custom SortingEasy
Trapping Rain WaterHard
Reverse the LinkedListEasy
Find length of longest substring of given string.Easy
Add two non-empty linked lists representing two non-negative integersMedium
Find an element in array after rotating an array by k steps to the rightMedium
Two SumEasy
Find cycle/loop in the graph – method 1Easy
Activity Selection problemEasy
Print m * n matrix diagonallyEasy
Generate Random Tree Based on max integerEasy
Next greater element in an arrayEasy
Detect a loop in a linked list and how it worksHard
Find a peak element in an arrayMedium
Create a balanced Binary Search Tree (BST) from an arrayMedium
Lowest Common AncestorMedium
Find all possible paths in matrixMedium
Find first and last index of target element from sorted arrayEasy
Count number of valid substring in binary stringEasy
Merge two sorted arrays in a such a way that a newly generated array will be sorted.Easy
Replace keys with valid values from sentenceEasy
The Coin Change ProblemMedium
Is string permutation a palindrome or not ?Easy
Find middle node in LinkedListEasy
LinkedList Algorithms UtilityEasy
Circular Array RotationEasy
Generate fibonacci sequence in javaEasy
Shortest PalindromeEasy
Generate Binary Search TreeMedium
Optimal Binary Search TreeMedium
Topological Sort Graph AlgorithmHard
Directed and Undirected GraphEasy
Matrix Chain MultiplicationEasy
Matrix multiplication notesEasy
Maximum size square sub-matrix with all 1s or 0sMedium
Next Higher NumberMedium
Subset sum problemEasy
String interleaving problemMedium
Text justification problemMedium
Join ropes in such a way that the cost is minimum.Medium
PriorityQueue java exampleEasy
Algorithm to figure out if someone has won in a game of tic-tac-toe.Hard
Longest common subsequenceMedium
Rotate matrix by 90 degreesMedium
Longest Increasing SubsequenceMedium
Coin changing problemMedium
0/1 knapsack problem items with values and weightMedium
Longest Palindromic SubstringMedium
Google Interview Dynamic Programming on Stolen ValuesHard
Optimal Strategy Game Pick from Ends of array Dynamic ProgrammingHard
Knuth–Morris–Pratt(KMP) Pattern Matching(Substring search)Medium
Word Break Problem Dynamic ProgrammingMedium
All possible largest substrings with distinct charactersMedium
Google Interview find the longest substring T that contains m distinct charactersHard
Google Interview find if a given binary tree has duplicate sub trees or notMedium
Google Interview Tree node with x and y value on same levelEasy
Find all nodes at each level in binary treeEasy
Find inorder successor in a binary search treeEasy
Algorithm to create a binary tree with minimal heightMedium
Algorithm to find out whether there is a route between two nodesEasy
Utility for graph related algorithmEasy
Implement a function to check if a tree is balanced, valid AVL Tree.Easy
Write a program to sort a stack in ascending orderEasy
Tower of Hanoi in JavaMedium
Find missing number in arithmetic progressionMedium
Find out the TWO numbers which appear odd number of times in arrayEasy
How to get the value of a bit at a certain position from a byteMedium
Separate digit from integer without help of StringMedium
Algorithm for Glass of waterMedium
Given array find a subsequence of length 3 having maximum productHard
Whether two BSTs will be identical or not without actually constructing the treeMedium
Algorithm of n integers which can contain integers from 1 to n with repeated and absentEasy
Find the anagrams from a list of stringsMedium
Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.Easy
Print all possible substrings – JavaEasy
Find string contains unique character or not in JavaEasy
String Permutation in JavaEasy
Print all combinations of balanced parentheses – JavaMedium
Calculate the angle between hour hand and minute handMedium
Google Interview Algorithm Sort Given a 2D matrix of integersMedium
QuickSort in Java with google interview questionMedium
Java Binary SearchMedium
Java Pots of gold game – Google InterviewHard
Find the smallest range that includes at least one number from each of the k lists – GoogleMedium
Reverse a string using recursive method in JavaEasy
Cut the sticks – hackerrankMedium
Share