Skip to content

Category Archives: Analysis

Given an integer array arr of size N which contains distinct elements from 1 to N. The task is to check if a position in… Read More
Given a positive integer N, the task is to find the largest integer M such that 0 <= M < N and XOR(M, N) is… Read More
The price of a stock on each day is given in an array arr[] for N days, the task is to find the maximum profit… Read More
Given an integer Q representing the number of queries and an array where each query has an integer N. Our task is to iterate through… Read More
Prerequisite: NP-Completeness, Clique problem. A clique in a graph is a set of vertices where each vertex shares an edge with every other vertex. Thus,… Read More
Given an arr[] consisting of N elements, the task is to count all subarrays of size K having atleast one pair whose absolute difference is… Read More
Given an array arr[], we need to find the maximum sum of the even indexed elements that can be obtained by performing right shift operation… Read More
An algorithm like Insertion Sort can be understood easily by visualizing. In this article, a program that visualizes the Insertion Sort Algorithm has been implemented. The… Read More
Prerequisite: NP-Completeness, Independent set. An Independent Set S of graph G = (V, E) is a set of vertices such that no two vertices in… Read More
A Min Heap is a Complete Binary Tree in which the children nodes have a higher value (lesser priority) than the parent nodes, i.e., any… Read More
Given a string str of lowercase English alphabets, our task is to find the frequency of occurrence a subsequence of the string which occurs the… Read More
Given a string str and an integer K, the task is to find the length of the longest sub-string S such that every character in… Read More
Given an N-sided regular polygon, we have connected all the vertices at the center of the polygon, thus dividing the polygon into N equal parts.… Read More
Given an array arr[] of N integers, the task is to find the maximum length subarray that contains similar elements.Examples:   Input: arr[] = {1, 2,… Read More

Start Your Coding Journey Now!