Array | Searching

Recent articles on Array Searching

  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. Searching in an array where adjacent differ by at most k
  5. Find common elements in three sorted arrays
  6. Find position of an element in a sorted array of infinite numbers
  7. Find the only repetitive element between 1 to n-1
  8. Find the element that appears once
  9. Maximum Subarray Sum Excluding Certain Elements
  10. Maximum equlibrium sum in an array
  11. Equilibrium index of an array
  12. Leaders in an array
  13. Ceiling in a sorted array
  14. Majority Element
  15. Check for Majority Element in a sorted array
  16. Check if an array has a majority element
  17. Two Pointers Technique
  18. Find a peak element
  19. Find the two repeating elements in a given array
  20. Find a Fixed Point in a given array
  21. Find sub-array with given sum
  22. Maximum triplet sum in array
  23. Smallest Difference Triplet from Three arrays
  24. Find a triplet that sum to a given value
  25. Find all triplets with zero sum
  26. All unique triplets that sum up to a given value
  27. Count triplets with sum smaller than a given value
  28. Print all triplets in sorted array that form AP
  29. Number of unique triplets whose XOR is zero
  30. Find a triplet such that sum of two equals to third element
  31. Find the Number Occurring Odd Number of Times
  32. Find the Missing Number
  33. Count number of occurrences (or frequency) in a sorted array
  34. Given a sorted array and a number x, find the pair in array whose sum is closest to x
  35. Count 1’s in a sorted binary array
  36. Find the first repeating element in an array of integers
  37. Find lost element from a duplicated array
  38. Find the repeating and the missing | Added 3 new methods
  39. Find the two numbers with odd occurrences in an unsorted array
  40. Find a pair with the given difference
  41. Find four elements that sum to a given value | Set 1 (n^3 solution)
  42. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  43. Find if there is a sub-array with 0 sum
  44. Search an element in an array where difference between adjacent elements is 1
  45. Third largest element in an array of distinct elements
  46. Check if there exist two elements in an array whose sum is equal to the sum of rest of the array
  47. Check if a given array contains duplicate elements within k distance from each other
  48. Search an element in an unsorted array using minimum number of comparisons
  49. Count of only repeated element in a sorted array of consecutive elements
  50. Find element in a sorted array whose frequency is greater than or equal to n/2.
  51. Minimum absolute difference of adjacent elements in a circular array
  52. Find the first, second and third minimum elements in an array
  53. Program to find the minimum (or maximum) element of an array
  54. Closest greater element for every array element from another array
  55. Count frequencies of all elements in array in O(1) extra space and O(n) time
  56. Pair with given sum and maximum shortest distance from end
  57. Delete an element from array (Using two traversals and one traversal)
  58. Count Inversions of size three in a given array
  59. Count pairs with given sum
  60. Binary search in sorted vector of pairs
  61. Trapping Rain Water
  62. Replacing an element makes array elements consecutive
  63. k-th missing element in sorted array
  64. Median of two sorted arrays with different sizes in O(log(min(n, m)))
  65. Print uncommon elements from two sorted arrays
  66. Non-Repeating Element
  67. Most frequent element in an array
  68. Least frequent element in an array
  69. Maximum difference between two subsets of m elements
  70. Maximum sum of increasing order elements from n arrays
  71. Pairs such that one is a power multiple of other
  72. Find number of pairs in an array such that their XOR is 0
  73. Minimum distance between two occurrences of maximum
  74. Find final value if we double after every successful search in array
  75. Last duplicate element in a sorted array
  76. Find an array element such that all elements are divisible by it
  77. Find k maximum elements of array in original order
  78. Maximum in array which is at-least twice of other elements
  79. Consecutive steps to roof top
  80. Maximum difference between groups of size two
  81. Minimum difference between groups of size two
  82. Closest numbers from a list of unsorted integers
  83. Maximum absolute difference of value and index sums
  84. Number of local extrema in an array
  85. Check if an array has a majority element
  86. Find closest number in array
  87. Number of pairs with maximum sum
  88. Print n smallest elements from given array in their original order
  89. Find first k natural numbers missing in given array
  90. Noble integers in an array (count of greater elements is equal to value)
  91. Minimum sum of absolute difference of pairs of two arrays
  92. Find sum of non-repeating (distinct) elements in an array
  93. Check whether Arithmetic Progression can be formed from the given array
  94. Minimum product subset of an array
  95. Count ways of choosing a pair with maximum difference
  96. Repeatedly search an element by doubling it after every successful search
  97. Maximum sum of pairwise product in an array with negative allowed

Quick Links :

My Personal Notes arrow_drop_up

Writing code in comment? Please use, generate link and share the link here.