# Category Archives: Algorithms

## Min steps to convert N-digit prime number into another by replacing a digit in each step

Given two N-digit prime numbers A and B, the task is to find the minimum number of steps taken to convert A to B. Condition… Read More »

## Find the missing end tag in the given HTML Code

Given a string htmlCode which is HTML code of a webpage, the task is to find the missing end tag in the HTML code. Examples:… Read More »

## How to generate Large Prime numbers for RSA Algorithm

The security of the RSA algorithm is based on the difficulty of factorizing very large numbers. The setup of an RSA cryptosystem involves the generation… Read More »

## Find all possible ways to Split the given string into Primes

Given a string str that represents a number. The task is to find all possible ways to split the given string such that each segment… 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 »

## Fast Doubling method to find the Nth Fibonacci number

Given an integer N, the task is to find the N-th Fibonacci numbers. Examples: Input: N = 3 Output: 2 Explanation: F(1) = 1, F(2)… Read More »

## Check if Matrix sum is prime or not

Given a matrix mat[][], the task is to check that the sum of the elements of the matrix is prime or not. Examples: Input: mat[][]… Read More »

## Sort a string lexicographically using triple cyclic shifts

Given a string consisting of the first N distinct alphabets, the task is to sort the string by using at most N/2 moves. Each move… 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 »

## Hotel Management System

Given the data for Hotel management and User: Hotel Data: Hotel Name Room Available Location Rating Price per Room H1 4 Bangalore 5 100 H2… Read More »

## Sum of sum-series of first N Natural numbers

Given a natural number n, find the sum of sum-series of first N natural number. Sum-Series: is sum of first N natural numbers, i.e, sum-series… Read More »

## Check if the remainder of N-1 factorial when divided by N is N-1 or not

Given an integer N where 1 ≤ N ≤ 105, the task is to find whether (N-1)! % N = N – 1 or not.… Read More »

## Min number of operations to reduce N to 0 by subtracting any digits from N

Given a number N, the task is to find the minimum number of operations required to reduce the number N to zero by subtracting the… Read More »

## Place Value of a given digit in a number

Place value can be defined as the value represented by a digit in a number on the basis of its position in the number. Here… Read More »