Here I am going to mention the list of major algorithms asked during Interviews. You can find the list as below.
Major algorithms asked during Interviews.
Below are the books I highly recommend for algorithms
Graph
3. Shortest Path from source to all vertices **Dijkstra**
4. Shortest Path from every vertex to every other vertex **Floyd Warshall**
5. To detect cycle in a Graph **Union Find**
6. Minimum Spanning tree **Prim**
7. Minimum Spanning tree **Kruskal**
9. Boggle (Find all possible words in a board of characters)
Linked List
1. Insertion of a node in Linked List (On the basis of some constraints)
2. Delete a given node in Linked List (under given constraints)
3. Compare two strings represented as linked lists
4. Add Two Numbers Represented By Linked Lists
5. Merge A Linked List Into Another Linked List At Alternate Positions
6. Reverse A List In Groups Of Given Size
7. Union And Intersection Of 2 Linked Lists
8. Detect And Remove Loop In A Linked List
9. Merge Sort For Linked Lists
10. Select A Random Node from A Singly Linked List
Dynamic Programming
2. Longest Increasing Subsequence
8. Optimal Strategy for a Game
10. Boolean Parenthesization Problem
Sorting And Searching
2. Search an element in a sorted and rotated array
3. Bubble Sort
5. Merge Sort
7. Quick Sort
9. Find Kth Smallest/Largest Element In Unsorted Array
10. Given a sorted array and a number x, find the pair in array whose sum is closest to x
Tree / Binary Search Tree
1. Find Minimum Depth of a Binary Tree
2. Maximum Path Sum in a Binary Tree
3. Check if a given array can represent Preorder Traversal of Binary Search Tree
4. Check whether a binary tree is a full binary tree or not
6. Print Nodes in Top View of Binary Tree
7. Remove nodes on root to leaf paths of length < K
8. Lowest Common Ancestor in a Binary Search Tree
9. Check if a binary tree is subtree of another binary tree
10. Reverse alternate levels of a perfect binary tree
Number Theory
2. Modular multiplicative inverse
3. Primality Test | Set 2 (Fermat Method)
6. Convex Hull
7. Basic and Extended Euclidean algorithms
10. Lucas Theorem
BIT Manipulation
2. Magic Number
3. Sum of bit differences among all pairs
4. Swap All Odds And Even Bits
5. Find the element that appears once
6. Binary representation of a given number
7. Count total set bits in all numbers from 1 to n
9. Count number of bits to be flipped to convert A to B
String / Array
1. Reverse an array without affecting special characters
2. All Possible Palindromic Partitions
3. Count triplets with sum smaller than a given value
4. Convert array into Zig-Zag fashion
5. Generate all possible sorted arrays from alternate elements of two given sorted arrays
6. Pythagorean Triplet in an array
7. Length of the largest subarray with contiguous elements
9. Smallest subarray with sum greater than a given value
10. Stock Buy Sell to Maximize Profit
This list is taken from one of the Quora answer by Geeksforgeeks employee.
Few of the python implementation are below.
Algorithms: Binary Search Tree and its functionality in python
Level order traversal of a binary tree in python.
Algorithms: Left view of a binary tree.
Algorithms: Mirror a Binary tree using python
Algorithms: Coding a linked list in python
3 COMMENTS
Hi,
Useful article. Understood the concept. Thanks for sharing.
Cheers,
http://www.flowerbrackets.com/binary-search-program-java/
You have good collection of sorting algorithms. Thanks for sharing.
Cheers,
http://www.flowerbrackets.com/how-to-implement-quick-sort-in-java-program/
You know what.. your article has best explanation and links on sorting algorithms. Thanks for sharing.
Cheers,
http://www.flowerbrackets.com/java-merge-sort/