Skip to content

Category Archives: Divide and Conquer

Question: Write a C function to find if a given integer x appears more than n/2 times in a sorted array of n integers. Basically, we… Read More
  Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then… Read More
  There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after… Read More
  Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t… Read More