# Category Archives: Algorithms (adsbygoogle = window.adsbygoogle || []).push({});

## Alternate XOR operations on sorted array

Given an array arr[] and two integers X and K. The task is to perform the following operation on array K times: Sort the array.… Read More »

## Sum of the Tan(x) expansion upto N terms

Given two integers N and X. The task is to find the sum of tan(x) series up to N terms. The series : x +… Read More »

## Perimeter of an Ellipse

An ellipse is described as a curve on a plane that surrounds two focal points such that the sum of the distances to the two… Read More »

## Sum of the distances from every node to all other nodes is maximum

Given a tree with N nodes and N-1 edges with root at 1 and given an array of N-1 integers. The task is to assign… Read More »

## Divide the array in K segments such that the sum of minimums is maximized

Given an array a of size N and an integer K, the task is to divide the array into K segments such that sum of… Read More »

## Maximum value after merging all elements in the array

Given an array a of size N. The task is to merge all elements in the array and find the maximum possible value. One can… Read More »

## Reverse tree path using Queue

Given a tree and a node, the task is to reverse the path till the given Node and print the in-order traversal of the modified… Read More »

## Implement a Dictionary using Trie

Implement a dictionary using Trie such that if the input is a string representing a word, the program prints its meaning from the prebuilt dictionary.… Read More »

## Program to Find the Incenter of a Triangle

Given the vertices of a triangle and length of its sides. A circle is inscribed in a triangle. The task is to find the incenter… Read More »

## Maximum length sub-array which satisfies the given conditions

Given a binary array arr[], the task is to find the length of the longest sub-array of the given array such that if the sub-array… Read More »

## Maximum possible elements which are divisible by 2

Given an integer array arr of size N. The task is to find the maximum possible elements in the array which are divisible by 2… Read More »

## Find k ordered pairs in array with minimum difference d

Given an array arr[] and two integers K and D, the task is to find exactly K pairs (arr[i], arr[j]) from the array such that… Read More »

## Minimum operations required to convert X to Y by multiplying X with the given co-primes

Given four integers X, Y, P and Q such that X ≤ Y and gcd(P, Q) = 1. The task is to find minimum operation… Read More »

## Count ways to divide circle using N non-intersecting chord | Set-2

Given a number N. The task is to find the number of ways you can draw N chords in a circle with 2*N points such… Read More »

## Partition the array in K segments such that bitwise AND of individual segment sum is maximized

Given an array of size N and an integer K. The task is to partition the array in K segments such that bitwise AND of… Read More »