Algorithms – Array Problems

  1. Depth First Search/Traversal in Binary Tree
  2. Check if Array is Consecutive Integers
  3. In an Array, find the Contiguous Subarray with Sum to a Given Value.
  4. In an Array, find the Smallest Subarray with Sum Greater than the Given Value
  5. Rearrange Positive and Negative Elements at Alternate Positions in an Array In O(1) Extra Space
  6. Find intersection between Two Sorted Arrays.
  7. Find Kth Smallest or Largest element in an Array.
  8. Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].
  9. Find All Elements in an Array which appears more than N/K times, N is Array Size and k is a Number.
  10. Search an Element in a Rotated Sorted Array
  11. Print All The Permutations Of a String
  12. Sort an Given Array in the order defined by another array
  13. Sort an Array such that the odd numbers appear first followed by the even numbers . The odd numbers in ascending order and the even numbers in descending order.
  14. Find the number of occurrences of a number in a given sorted array.
  15. Find all common numbers in given three sorted arrays.
  16. Find the first repeated element in an array by its index
  17. Minimum number that cannot be formed by any subset of an array
  18. Sorted Array to Binary Search Tree of Minimal Height
  19. Count All Paths from Top left to bottom right in Two Dimensional Array including Diagonal Paths
  20. Print All Paths from Top left to bottom right in Two Dimensional Array
  21. Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn)
  22. Find The Longest Sequence Of Prefix Shared By All The Words In A String
  23. Print All Elements of Two Dimensional Array in Spiral
  24. Given an array and a number k, check for pair in array with sum as k in O(nlgn)
  25. Quick Sort Implementation
  26. Find an Element in 2 dimensional sorted array
  27. Find Whether Given String is palindrome or Not.
  28. Find a peak element in a Given Array
  29. Find two Missing Numbers in a Sequence of Consecutive Numbers
  30. Find a Missing Number From a Sequence of Consecutive Numbers
  31. Merge Sort — Updated — Most Efficient ways to Implement
  32. Binary Search

__________________________________________________
Top Companies Interview Questions..-

Google Microsoft Amazon Facebook more..

If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.
__________________________________________________

%d bloggers like this: