Array is a data structure used to store homogeneous elements at contiguous locations. Size of an array must be provided before storing data.

  1. Search, insert and delete in an unsorted array
  2. Search, insert and delete in a sorted array
  3. Given an array A[] and a number x, check for pair in A[] with sum as x
  4. Majority Element
  5. Find the Number Occurring Odd Number of Times
  6. Largest Sum Contiguous Subarray
  7. Find the Missing Number
  8. Search an element in a sorted and pivoted array
  9. Merge an array of size n into another array of size m+n
  10. Median of two sorted arrays
  11. Write a program to reverse an array
  12. Program for array rotation
  13. Reversal algorithm for array rotation
  14. Block swap algorithm for array rotation
  15. Maximum sum such that no two elements are adjacent
  16. Leaders in an array
  17. Sort elements by frequency | Set 1
  18. Count Inversions in an array
  19. Two elements whose sum is closest to zero
  20. Find the smallest and second smallest element in an array
  21. Check for Majority Element in a sorted array
  22. Maximum and minimum of an array using minimum number of comparisons
  23. Segregate 0s and 1s in an array
  24. k largest(or smallest) elements in an array | added Min Heap method
  25. Maximum difference between two elements
  26. Union and Intersection of two sorted arrays
  27. Floor and Ceiling in a sorted array
  28. A Product Array Puzzle
  29. Segregate Even and Odd numbers
  30. Find the two repeating elements in a given array
  31. Sort an array of 0s, 1s and 2s
  32. Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted
  33. Find duplicates in O(n) time and O(1) extra space
  34. Equilibrium index of an array
  35. Linked List vs Array
  36. Which sorting algorithm makes minimum number of memory writes?
  37. Turn an image by 90 degree
  38. Next Greater Element
  39. Check if array elements are consecutive | Added Method 3
  40. Find the smallest missing number
  41. Count the number of occurrences in a sorted array
  42. Interpolation search vs Binary search
  43. Given an array arr[], find the maximum j – i such that arr[j] > arr[i]
  44. Maximum of all subarrays of size k (Added a O(n) method)
  45. Find whether an array is subset of another array | Added Method 3
  46. Find the minimum distance between two numbers
  47. Find the repeating and the missing | Added 3 new methods
  48. Median in a stream of integers (running integers)
  49. Find a Fixed Point in a given array
  50. Maximum Length Bitonic Subarray
  51. Find the maximum element in an array which is first increasing and then decreasing
  52. Count smaller elements on right side
  53. Minimum number of jumps to reach end
  54. Implement two stacks in an array
  55. Find subarray with given sum
  56. Dynamic Programming | Set 14 (Maximum Sum Increasing Subsequence)
  57. Longest Monotonically Increasing Subsequence Size (N log N)
  58. Find a triplet that sum to a given value
  59. Find the smallest positive number missing from an unsorted array
  60. Find the two numbers with odd occurrences in an unsorted array
  61. The Celebrity Problem
  62. Dynamic Programming | Set 15 (Longest Bitonic Subsequence)
  63. Find a sorted subsequence of size 3 in linear time
  64. Largest subarray with equal number of 0s and 1s
  65. Dynamic Programming | Set 18 (Partition problem)
  66. Maximum Product Subarray
  67. Find a pair with the given difference
  68. Replace every element with the next greatest
  69. Dynamic Programming | Set 20 (Maximum Length Chain of Pairs)
  70. Find four elements that sum to a given value | Set 1 (n^3 solution)
  71. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  72. Sort a nearly sorted (or K sorted) array
  73. Maximum circular subarray sum
  74. Find the row with maximum number of 1s
  75. Median of two sorted arrays of different sizes
  76. Shuffle a given array
  77. Count the number of possible triangles
  78. Iterative Quick Sort
  79. Find the number of islands
  80. Construction of Longest Monotonically Increasing Subsequence (N log N)
  81. Find the first circular tour that visits all petrol pumps
  82. Arrange given numbers to form the biggest number
  83. Pancake sorting
  84. A Pancake Sorting Problem
  85. Tug of War
  86. Divide and Conquer | Set 3 (Maximum Subarray Sum)
  87. Counting Sort
  88. Merge Overlapping Intervals
  89. Find the maximum repeating number in O(n) time and O(1) extra space
  90. Stock Buy Sell to Maximize Profit
  91. Rearrange positive and negative numbers in O(n) time and O(1) extra space
  92. Sort elements by frequency | Set 2
  93. Find a peak element
  94. Print all possible combinations of r elements in a given array of size n
  95. Given an array of of size n and a number k, find all elements that appear more than n/k times
  96. Find the point where a monotonically increasing function becomes positive first time
  97. Find the Increasing subsequence of length three with maximum product
  98. Find the minimum element in a sorted and rotated array
  99. Stable Marriage Problem
  100. Merge k sorted arrays | Set 1
  101. Radix Sort
  102. Move all zeroes to end of array
  103. Find number of pairs such that x^y > y^x
  104. Count all distinct pairs with difference equal to k
  105. Find if there is a subarray with 0 sum
  106. Smallest subarray with sum greater than a given value
  107. Sort an array according to the order defined by another array
  108. Maximum Sum Path in Two Arrays
  109. Sort an array in wave form
  110. K’th Smallest/Largest Element in Unsorted Array
  111. K’th Smallest/Largest Element in Unsorted Array in Expected Linear Time
  112. K’th Smallest/Largest Element in Unsorted Array in Worst Case Linear Time
  113. Find Index of 0 to be replaced with 1 to get longest continuous sequence of 1s in a binary array
  114. Find the closest pair from two sorted arrays
  115. Given a sorted array and a number x, find the pair in array whose sum is closest to x
  116. Count 1’s in a sorted binary array
  117. Print All Distinct Elements of a given integer array
  118. Construct an array from its pair-sum array
  119. Find common elements in three sorted arrays
  120. Find the first repeating element in an array of integers
  121. Find the smallest positive integer value that cannot be represented as sum of any subset of a given array
  122. Rearrange an array such that ‘arr[j]’ becomes ‘i’ if ‘arr[i]’ is ‘j’
  123. Find position of an element in a sorted array of infinite numbers
  124. Can QuickSort be implemented in O(nLogn) worst case time complexity?
  125. Check if a given array contains duplicate elements within k distance from each other
  126. Find the element that appears once
  127. Replace every array element by multiplication of previous and next
  128. Check if any two intervals overlap among a given set of intervals
  129. Delete an element from array (Using two traversals and one traversal)
  130. Find the largest pair sum in an unsorted array
  131. Online algorithm for checking palindrome in a stream
  132. Pythagorean Triplet in an array
  133. Maximum profit by buying and selling a share at most twice
  134. Find Union and Intersection of two unsorted Arrays
  135. Count frequencies of all elements in array in O(1) extra space and O(n) time
  136. Generate all possible sorted arrays from alternate elements of two given sorted arrays
  137. Minimum number of swaps required for arranging pairs adjacent to each other
  138. Trapping Rain Water 
  139. Convert array into Zig-Zag fashion
  140. Find maximum average subarray of k length  
  141. Find maximum value of Sum( i*arr[i]) with only rotations on given array allowed  
  142. Reorder an array according to given indexes  
  143. Find zeroes to be flipped so that number of consecutive 1’s is maximized  
  144. Count triplets with sum smaller than a given value  
  145. Find the subarray with least average  
  146. Count Inversions of size three in a give array
  147. Longest Span with same Sum in two Binary arrays
  148. Merge two sorted arrays with O(1) extra space
  149. Form minimum number from given sequence
  150. Subarray/Substring vs Subsequence and Programs to Generate them
  151. Count Strictly Increasing Subarrays
  152. Rearrange an array in maximum minimum form
  153. Find minimum difference between any two elements
  154. Find lost element from a duplicated array
  155. Count pairs with given sum
  156. Count minimum steps to get the given desired array
  157. Find minimum number of merge operations to make an array palindrome
  158. Minimize the maximum difference between the heights

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Company Wise Coding Practice    Topic Wise Coding Practice