Queries for elements greater than K in the given index range using Segment Tree
Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R and K. For each… Read More »
Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R and K. For each… Read More »
Given K vectors, the task is to design a cyclic iterator that prints the elements of these vectors in a cyclic manner. For example: v1… Read More »
Given a binary string str and an integer K, the task is to find the minimum cost required to partition the string into exactly K… Read More »
Given N dependencies of the form X Y, where X & Y represents two different tasks. The dependency X Y denotes dependency of the form… Read More »
Given a tree and a node, the task is to find the parent of the given node in the tree. Print -1 if the given… Read More »
Given a number N and a power P, the task is to find the exponent of this number raised to the given power, i.e. NP.… Read More »
Given an integer N, the task is to find all of its divisors using its prime factorization. Examples: Input: N = 6 Output: 1 2… Read More »
Given an array arr[] of N integers, the task is to make two binary search trees. One while traversing from the left side of the… Read More »
Count number of ways to arrange the first N natural numbers in a line such that the left-most number is always 1 and no two… Read More »
Given a string str and a string array arr[], the task is to find the minimum count of substrings this can be splitted into such… Read More »
Write a program in C++ to print an Array using Recursion Using static variable: Static variables have a property of preserving their value even after… Read More »
Given a linked list which represents an integer number where each node is a digit of the represented integer. The task is to add a… Read More »
Given an array arr[] and an integer K. The task is to divide the array into K parts ( subarray ) such that the sum… Read More »
The basic version of the Tower of Hanoi can be found here. It is a twisted Tower of Hanoi problem. In which, all rules are… Read More »
Given 3 integers N, M and K. The task is to find maximum P such that N * KP <= M . Examples: Input :N… Read More »