Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
Misc
7.8K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Strings
2.1K+ articles
Greedy
1.4K+ articles
Sorting
1.1K+ articles
Dynamic Programming
1.1K+ articles
Searching
1.0K+ articles
Tree
909+ articles
DSA
/
Algorithms
/
Analysis of Algorithms
Analysis of Algorithms
187+ posts
Recent Articles
Popular Articles
3-coloring is NP Complete
Last Updated: 15 July 2025
Prerequisite: NP-Completeness, Graph ColoringGraph K-coloring Problem: A K-coloring problem for undirected graphs is an assignment of colors to the nodes of the graph such...
read more
Misc
Graph
Analysis of Algorithms
DSA
NP Complete
Rearrange and update array elements as specified by the given queries
Last Updated: 15 July 2025
Given an array arr[] of size N and queries Q[][], the task is to perform the following types of queries on the given array. 0: Left shift the array by one position.1: Righ...
read more
Queue
Analysis of Algorithms
Mathematical
Advanced Data Structure
DSA
Arrays
array-range-queries
array-rearrange
deque
Big O vs Theta Θ vs Big Omega Ω Notations
Last Updated: 15 July 2025
1. Big O notation (O):It defines an upper bound on order of growth of time taken by an algorithm or code with input size. Mathematically, if f(n) describes the running tim...
read more
Analysis of Algorithms
Difference Between
GATE CS
DSA
Determine winner of the Game by arranging balls in a row
Last Updated: 01 April 2021
Given the number of small and large balls N and M respectively, the task is to find which player wins if both the player X and Y play optimally by making the following two...
read more
Analysis of Algorithms
Greedy
Mathematical
Game Theory
DSA
Check if a large number is divisible by a number which is a power of 2
Last Updated: 11 May 2021
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 string str is divisible by the K or not, where K is a power o...
read more
Strings
Analysis of Algorithms
Mathematical
C++ Programs
DSA
divisibility
large-numbers
maths-power
Count of subarrays of size K having at least one pair with absolute difference divisible by K-1
Last Updated: 15 July 2025
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 divisible by K - 1.Examples:Inpu...
read more
Analysis of Algorithms
Mathematical
DSA
Arrays
divisibility
subarray
Pigeonhole Principle
Check if given permutation of 1 to N can be counted in clockwise or anticlockwise direction
Last Updated: 30 May 2022
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 the array can be found such that all numbers from ...
read more
Analysis of Algorithms
DSA
Arrays
permutation
Print all Strong numbers less than or equal to N
Last Updated: 15 July 2025
Given a number N, print all the Strong Numbers less than or equal to N.Strong number is a special number whose sum of the factorial of digits is equal to the original numb...
read more
Analysis of Algorithms
Greedy
Mathematical
Combinatorial
DSA
factorial
Count of pairs in a given range with sum of their product and sum equal to their concatenated number
Last Updated: 01 June 2021
Given two numbers A and B, the task is to find the count of pairs (X, Y) in range [A, B], such that (X * Y) + (X + Y) is equal to the number formed by concatenation of X a...
read more
Analysis of Algorithms
Mathematical
Write From Home
DSA
array-range-queries
Natural Numbers
Last digit of a number raised to last digit of N factorial
Last Updated: 15 July 2025
Given two number X and N, the task is to find the last digit of X raised to last digit of N factorial, i.e.X^{\left ( N! \right )mod 10}.Examples:Input: X = 5, N = 2Output...
read more
Analysis of Algorithms
Mathematical
DSA
number-digits
factorial
maths-power
Minimum sprinklers required to water a rectangular park
Last Updated: 25 September 2022
Given N * M rectangular park having N rows and M columns, each cell of the park is a square of unit area and boundaries between the cells is called hex and a sprinkler can...
read more
Analysis of Algorithms
Mathematical
Matrix
C++ Programs
DSA
square-rectangle
Proof that Dominant Set of a Graph is NP-Complete
Last Updated: 15 July 2025
Pre-requisite: Dominant Set of a Graph, NP-CompleteA dominating set in a graph G = (V, E) is a subset of vertices V’ following the condition that the vertices not belongin...
read more
Graph
Analysis of Algorithms
Advanced Data Structure
DSA
NPHard
NP Complete
Proof that traveling salesman problem is NP Hard
Last Updated: 15 July 2025
Pre-requisite: Travelling Salesman Problem, NP HardGiven a set of cities and the distance between each pair of cities, the travelling salesman problem finds the path betw...
read more
Graph
Analysis of Algorithms
Greedy
Advanced Data Structure
DSA
NPHard
Number of cycles formed by joining vertices of n sided polygon at the center
Last Updated: 28 June 2022
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. Our task is to the Count o...
read more
Analysis of Algorithms
Greedy
Pattern Searching
Mathematical
Geometric
Combinatorial
DSA
graph-cycle
Complexity analysis of various operations of Binary Min Heap
Last Updated: 15 July 2025
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 path from the root to the leaf node...
read more
Analysis of Algorithms
Heap
DSA
time complexity
Data Structures-Heap
min-heap
1
...
4
5
6
...
13
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !