This is the collection of algorithms, data structures and Interview Questions with solutions. This repository contains my solutions for common algorithmic problems and implementation of Data Structures in Java. I've created this repository to learn about algorithms. I am adding solutions continuously.
Interview Questions package include 3 text files (1easy, 2medium and 3Hard) and solutions for each question.
8 Algorithms, 2 Data Structures and 134 Interview Questions with answers are provided so far.
##Problems:
###Arrays
- Rotate Array
- Contains Duplicate
- Find Peak Element
- Maximum Subarray
- Kth Largest Element in an Array
- Find All Duplicates in an Array
- Longest Increasing Subsequence
And many other array problems
###Linked List
- Delete Node in a Linked List
- Palindrome Linked List
- Reverse Linked List
- Intersection of Two Linked Lists
- Linked List Cycle
- Remove Nth Node From End of List
- Merge Sort List
- Find Linked List Cycle
And many other Linked list problems
###Binary Tree
- Binary Tree Level Order Traversal
- Sum of Left Leaves
- Invert Binary Tree
- Binary Search Tree Iterator
- Binary Tree Postorder Traversal
- Binary Tree Preorder Traversal
- Flatten Binary Tree to Linked List
- Symmetric Tree
- Binary Tree Inorder Traversal
- Same Tree
- Maximum Depth of Binary Tree
- Balanced Binary Tree
- Minimum Depth of Binary Tree
- Merge k Sorted Lists
- Sorted List to Balanced Binary Search Tree
- Validate Binary Search Tree
- Sorted List to Balanced BST
- Kth Smallest Element in a BST
- Binary Tree Zigzag Level Order Traversal
- Delete Node in a BST
- [Lowest Common Ancestor of BST] (https://github.com/sherxon/AlgoDS/blob/master/src/interviewquestions/easy/LowestCommonAncestorBST.java)
And many other tree problems
###Math
- Integer Break
- Reverse Bits
- Palindrome Number
- Math.pow
- Jug and Water Problem
- [Sieve of Eratosthenes] (https://github.com/sherxon/AlgoDS/blob/master/src/algo/numerals/SieveofEratosthenes.java)
- [Fermat's primality] (https://github.com/sherxon/AlgoDS/blob/master/src/algo/numerals/FermatPrimality.java)
###Misc
1)Permutations
2)Subsets
##Algorithms
###Sorting And Searching:
###Graphs:
- Breadth First Search (BFS)
- Depth First Search (DFS)
- Prim's Minimum Spanning Tree (MST)
- KrusKal's Minimum Spanning Tree (MST)
- Topological Sorting
- Shortest Path Dijsktra
- Shortest Path Bellman-Ford
###Dynamic Programming 1)Fibonacci Numbers
###String 1)Rabin Karp Subsequence search
##Data Structure:
###Trees:
1)Binary Search Tree (recursive)
2)Binary Search Tree (iterative)
3)AVL Tree