# Category Archives: Algorithms

Given a number N, the task is to find the number of zero’s in base K representation of the given number, where K > 1.… Read More
Given a number N, the task is to maximize this number by following the given conditions: The odd digit of the number can only be… Read More
Given an array arr[] of size N such that the sum of all the array elements does not exceed N, and array queries[] containing Q… Read More
Given an array arr[] of size N representing the time taken by a person to complete a task. Also, an array restTime[] which denotes the… Read More
Given a Binary search tree having N nodes, the task is to find all the paths starting at the root and ending at any leaf… Read More
Given a positive integer N, the task is to find the minimum number of subtractions of power of 2 required to convert N to 0.… Read More
Given an N-ary Tree. The task is to print the level order traversal of the tree where each level will be in a new line.… Read More
Given an integer N, the task is to find all possible integer M in the range [2, N] such that the bitwise OR of all… Read More
Given a binary array arr[] of size N, the task is to find the count of distinct alternating triplets. Note: A triplet is alternating if… Read More
Given a connected acyclic graph with N nodes numbered from 1 to N and N-1 edges, find out the pair of nodes that are at… Read More
Given an array arr[] which contains N positive integers and an integer K. The task is to count all triplets whose XOR is equal to… Read More
Given an array arr[] of length N (N > 1)containing positive integers, the task is to encrypt the numbers of the array into a single… Read More
Given an array arr[] of size N consisting of positive integers, the task is to check if the array can be sorted in non-decreasing order… Read More
Given a string S of size N consisting of the characters 0, 1 and 2, the task is to find the length of the smallest… Read More
Given an array of integers arr[] of size N and an integer K, the task is to find the smallest prime such that it gives… Read More