# Category Archives: Algorithms

## Count of triplets in an Array such that A[i] * A[j] = A[k] and i < j < k

Given an array A[ ] consisting of N positive integers, the task is to find the number of triplets A[i], A[j] & A[k] in the… Read More »

## Count of pairs of strings whose concatenation forms a palindromic string

Given an array A[ ] consisting of N strings, the task is to count the number of pairs of possible strings that on merging forms… Read More »

## Find the word with most anagrams in a given sentence

Given a string S in the form of a sentence, the task is to find the word from the text with maximum number of its… Read More »

## Convert camel case string to snake case in Java

Given a string in camel case, the task is to write a Java program to convert the given string from camel case to snake case… Read More »

## Find cells in Matrix that are not visited by Robot for given movements

Given an integer N, which denotes the size of the matrix that is N*N. There is a robot placed over the top-left corner of the… Read More »

## Linear Congruence method for generating Pseudo Random Numbers

Linear Congruential Method is a class of Pseudo Random Number Generator (PRNG) algorithms used for generating sequences of random-like numbers in a specific range. This… Read More »

## Multiplicative Congruence method for generating Pseudo Random Numbers

Multiplicative Congruential Method (Lehmer Method) is a type of linear congruential generator for generating pseudorandom numbers in a specific range. This method can be defined… Read More »

## Additive Congruence method for generating Pseudo Random Numbers

Additive Congruential Method is a type of linear congruential generator for generating pseudorandom numbers in a specific range. This method can be defined as:  where,… Read More »

## Convert given Decimal number into an irreducible Fraction

Given a decimal number as N, the task is to convert N into an equivalent irreducible fraction. An irreducible fraction is a fraction in which… Read More »

## Missing vertex among N axis-parallel rectangles

Given N axis-parallel rectangles in a 2-D cartesian coordinate system and coordinates of 4N-1 vertices, the task is to find the single vertex missing.Examples: Input:… Read More »

## Minimum distance between the maximum and minimum element of a given Array

Given an array A[] consisting of N elements, the task is to find the minimum distance between the minimum and the maximum element of the… Read More »

## Menu-Driven program for Phone Directory

Problem Statement: Write a menu-driven program for using switch-case with following features: Store Contact numbers of people Search for the Contact numbers using their names… Read More »

## Puzzle | Connect 9 circles each arranged at center of a Matrix using 3 straight lines

Consider 9 circles each arranged at the center of cells of a 2-D matrix of shape 3*3. Draw 3 straight lines without removing pen from… Read More »

## Local and Global Optimum in Uni-variate Optimization

Uni-variate optimization is a simple case of a non-linear optimization problem with an unconstrained case that is there is no constraint. Uni-variate optimization may be… Read More »

## Converting Power Law Distribution to a Linear graph

Whenever we are working on ML projects, we have to deal with the high dimensionality of the dataset. There is a very particular term to… Read More »