My solutions for https://www.geeksforgeeks.org/top-10-algorithms-in-interview-questions/ (Added html file to repo) in both Python and Java.
Questions:
Breadth First Search (BFS)Depth First Search (DFS)- Shortest Path from source to all vertices Dijkstra
- Shortest Path from every vertex to every other vertex Floyd Warshall
- To detect cycle in a Graph Union Find
- Minimum Spanning tree Prim
- Minimum Spanning tree Kruskal
- Topological Sort
- Boggle (Find all possible words in a board of characters)
- Bridges in a Graph
Extra:
Insertion of a node in Linked List (On the basis of some constraints)Delete a given node in Linked List (under given constraints)Compare two strings represented as linked listsAdd Two Numbers Represented By Linked ListsMerge A Linked List Into Another Linked List At Alternate PositionsReverse A List In Groups Of Given SizeUnion And Intersection Of 2 Linked ListsDetect And Remove Loop In A Linked ListMerge Sort For Linked ListsSelect A Random Node from A Singly Linked List
Extra:
Longest Common SubsequenceLongest Increasing SubsequenceEdit DistanceMinimum PartitionWays to Cover a DistanceLongest Path In MatrixSubset Sum ProblemOptimal Strategy for a Game0-1 Knapsack Problem- Boolean Parenthesization Problem
Binary SearchSearch an element in a sorted and rotated arrayBubble SortInsertion SortMerge SortHeap Sort (Binary Heap)Quick SortInterpolation SearchFind Kth Smallest/Largest Element In Unsorted ArrayGiven a sorted array and a number x, find the pair in array whose sum is closest to x
Find Minimum Depth of a Binary TreeMaximum Path Sum in a Binary TreeCheck if a given array can represent Preorder Traversal of Binary Search TreeCheck whether a binary tree is a full binary tree or notBottom View Binary TreePrint Nodes in Top View of Binary TreeRemove nodes on root to leaf paths of length < KLowest Common Ancestor in a Binary Search TreeCheck if a binary tree is subtree of another binary treeReverse alternate levels of a perfect binary tree
- Modular Exponentiation
- Modular multiplicative inverse
- Primality Test | Set 2 (Fermat Method)
- Euler’s Totient Function
- Sieve of Eratosthenes
- Convex Hull
- Basic and Extended Euclidean algorithms
- Segmented Sieve
- Chinese remainder theorem
- Lucas Theorem
Maximum Subarray XORMagic NumberSum of bit differences among all pairsSwap All Odds And Even BitsFind the element that appears onceBinary representation of a given numberCount total set bits in all numbers from 1 to nRotate bits of a numberCount number of bits to be flipped to convert A to BFind Next Sparse Number
Reverse an array without affecting special charactersAll Possible Palindromic PartitionsCount triplets with sum smaller than a given valueConvert array into Zig-Zag fashionGenerate all possible sorted arrays from alternate elements of two given sorted arraysPythagorean Triplet in an arrayLength of the largest subarray with contiguous elementsFind the smallest positive integer value that cannot be represented as sum of any subset of a given arraySmallest subarray with sum greater than a given valueStock Buy Sell to Maximize Profit