## Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )

Giving k sorted arrays, each of size N, the task is to merge them into a single sorted array. Examples: Input : arr[][] = {{5,… Read More »

## Maximum length subsequence such that adjacent elements in the subsequence have a common factor

Given an array arr[], the task is to find the maximum length of a subsequence such that the adjacent elements in the subsequence have a… Read More »

## Count of pairs (x, y) in an array such that x < y

Given an array of N distinct integers, the task is to find the number of pairs (x, y) such that x < y. Example: Input:… Read More »

## Check whether the point (x, y) lies on a given line

Given the values of m and c for the equation of a line y = (m * x) + c, the task is to find… Read More »

## Minimize the sum of squares of sum of N/2 paired formed by N numbers

Given N numbers(N is an even number). Divide the N numbers into N/2 pairs in such a way that the sum of squares of the… Read More »

## Numbers less than N that are perfect cubes and the sum of their digits reduced to a single digit is 1

Given a number n, the task is to print all the numbers less than or equal to n which are perfect cubes as well as… Read More »

## Minimum replacements to make adjacent characters unequal in a ternary string | Set-2

Given a string of ‘0’, ‘1’ and ‘2’. The task is to find the minimum number of replacements such that the adjacent characters are not… Read More »

## Length of the longest alternating subarray

Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or… Read More »

## Composite numbers with digit sum 1

Given a range [L, R], the task is to find all the numbers from the range which are composite as well as the eventual sum… Read More »

## Array Manipulation and Sum

Given an array arr[] of N integers and an integer S. The task is to find an element K in the array such that if… Read More »

## Determine the count of Leaf nodes in an N-ary tree

Given the value of ‘N’ and ‘I’. Here, represents the number of internal nodes present in an N-ary tree and every node of the N-ary… Read More »

## Shortest path to traverse all the elements of a circular array in increasing order

There are N distinct integers arranged on a circle. The distance between any two adjacent numbers is 1. The task is to travel on this… Read More »

## Program for power of a complex number in O(log n)

Given a complex number of the form x + yi and an integer n, the task is to calculate the value of this complex number… Read More »

## Minimum elements to be removed such that sum of adjacent elements is always odd

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

## Find the value of ln(N!) using Recursion

Given a number N, the task is to find the log value of the factorial of N i.e. log(N!). Note: ln means log with base… Read More »