Tag Archives: Algorithms-Divide and Conquer

Given a mountain array arr[] and an integer X, the task is to find the smallest index of X in the given array. If no… Read More
Consider the problem of searching an element x in an array ‘arr[]’ of size n. The problem can be solved in O(Logn) time if. 1)… Read More
Consider a situation where you don’t have function to calculate power (pow() function in C) and you need to calculate x^n where x can be… Read More
Maximum Subarray Sum problem is to find the subarray with maximum sum. For example, given an array {12, -13, -5, 25, -20, 30, 10}, the… Read More
Consider the polynomial p(x) = a0 + a1x + a2x^2 +a3x^3, where ai != 0, for all i. The minimum number of multiplications needed to… Read More
Consider the following C program filter_none edit close play_arrow link brightness_4 code int main()  {     int x, y, m, n;     scanf ("%d %d", &x, &y); … Read More
Which of the following algorithms is NOT a divide & conquer algorithm by nature? (A) Euclidean algorithm to compute the greatest common divisor (B) Heap… Read More