UNDER DEVELOPMENT
Codes to the most common algorithms and interview questions.
-
Find Majority Element in an unsorted array of integers. -- [Code] (https://github.com/kevindra/Algorithms/blob/master/Arrays/MajorityElement.cpp)
-
Find all the elements that appear more than n/3 times in an array of integers. -- [Code] (https://github.com/kevindra/Algorithms/blob/master/Arrays/TwoMajorityElements.cpp)
- Implement power method without using multiply(*) and division(/) operators. -- [Code] (https://github.com/kevindra/Algorithms/blob/master/Numbers/PowerWithoutMultiplyOrDivideOperators.cpp)
- Given two string, write a function that prints all the interleavings of the given two strings. You may assume that all characters in both strings are different. An interleaved string of given two strings preserves the order of characters in individual strings. For example, in all the interleavings of above first example, ‘A’ comes before ‘B’ and ‘C’ comes before ‘D’. [Code] (https://github.com/kevindra/Algorithms/blob/master/Strings/interleavingsOfTwoStrings.cpp)
-
Two nodes of a BST are swapped, correct the BST. [Code] (https://github.com/kevindra/Algorithms/blob/master/Trees/CorrectTheBst.cpp)
-
Find if the given BST is correct. [Code] (https://github.com/kevindra/Algorithms/blob/master/Trees/isBST.cpp)