# Category Archives: Analysis

## Check if a large number is divisible by a number which is a power of 2

Given a large number in the form of a string str and a number K, the task is to check if the number formed by… Read More »

## Find Nth number in a sequence which is not a multiple of a given number

Given four integers A, N, L and R, the task is to find the N th number in a sequence of consecutive integers from L… Read More »

## Check if given permutation of 1 to N can be counted in clockwise or anticlockwise direction

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 »

## Largest number M less than N such that XOR of M and N is even

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 »

## Maximize profit in buying and selling stocks with Rest condition

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 »

## Count of paths in given Binary Tree with odd bitwise AND for Q queries

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 »

## Proof that Clique Decision problem is NP-Complete | Set 2

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 »

## Count of subarrays of size K having at least one pair with absolute difference divisible by K-1

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 »

## Maximum sum of even indexed elements obtained by right shift on an even sized subarray

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 »

## Sorting algorithm visualization : Insertion Sort

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.… Read More »

## Proof that Independent Set in Graph theory is NP Complete

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 »

## Complexity analysis of various operations of Binary Min Heap

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 »

## Frequency of maximum occurring subsequence in given string

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 »

## Largest substring where all characters appear at least K times | Set 2

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 »

## Number of cycles formed by joining vertices of n sided polygon at the center

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 »