Skip to content

Category Archives: Divide and Conquer

In this article, we are going to discuss how Divide and Conquer technique is helpful and how we can solve the problem with the DAC… Read More
Given two sorted arrays, a[] and b[], the task is to find the median of these sorted arrays, in O(log n + log m) time… Read More
Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array. Examples :  Input: arr[] = {8, 10,… Read More
Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is… Read More
  Given a sorted array arr[] and a number x, write a function that counts the occurrences of x in arr[]. Expected time complexity is… Read More
Given an integer array of length N (an arbitrarily large number). How to count number of set bits in the array?The simple approach would be, create an… Read More
Method 1 (Using Nested Loops)We can calculate power by using repeated addition. For example to calculate 5^6. 1) First 5 times add 5, we get 25. (5^2) 2)… Read More
Write a C function to return minimum and maximum in an array. Your program should make the minimum number of comparisons.  Recommended Practice Max Min… Read More
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 the… 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

Start Your Coding Journey Now!