# Category Archives: Algorithms

Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array… Read More
Given two stacks stack1[] and stack2[] of size N and M respectively and an integer K, The task is to count the maximum number of… Read More
Given a sequence of numbers in the form of a linked list lis. Find the length of the Longest Increasing Subsequence(LIS) of the given Linked… Read More
Given an array arr[] containing N positive integers, the task is to maximize the array sum when after every sum operation all the remaining array… Read More
Given an integer N. The task is to find the sum of the first N terms of the series 5, 11, 19, 29, 41, .… Read More
Given an array arr[] of even length N and an integer K denoting the range of numbers in the array i.e. the numbers in the… Read More
Given an array of pairs arr[] of size N where the first value of all the pairs are distinct. For each pair of the given… Read More
Given a binary string str of length N, the task is to count the maximum number of adjacent pairs of form “01” or “10” that… Read More
Floyd’s cycle finding algorithm or Hare-Tortoise algorithm is a pointer algorithm that uses only two pointers, moving through the sequence at different speeds. This algorithm… Read More
Given a positive integer, N. Find the sum of the first N term of the series-  0.1, 0.11, 0.111, 0.1111, ….till N terms Examples: Input:… Read More
Given an integer N, the task is to find the Nth term of the series  3, 8, 15, 24, . . .till Nth term Examples:… Read More
Given a positive integer, N. Find the sum of the first N term of the series- 1, (1+4), (1+4+42), (1+4+42+43), …., till N terms Examples:… Read More
Given an integer N, the task is to find the Nth term of the series  3, 11, 31, 69, . . . . . till… Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More