Skip to content

Category Archives: Algorithms

Given two polynomials represented by two arrays, write a function that multiplies given two polynomials.  Example:  Input: A[] = {5, 0, 10, 6} B[] =… Read More
Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each… Read More
Given a sorted array and a number x, find a pair in an array whose sum is closest to x. Examples: Input: arr[] = {10,… Read More
Consider the following C function. unsigned fun(unsigned n) {     if (n == 0) return 1;     if (n == 1) return 2;        return fun(n-1) +… Read More
Given a text string and a pattern string, check if a pattern exists in text or not.Few pattern searching algorithms (KMP, Rabin-Karp, Naive Algorithm, Finite… Read More
Given a positive number n, count all distinct Non-Negative Integer pairs (x, y) that satisfy the inequality x*x + y*y < n.  Examples: Input: n… Read More
This article is continuation of following five articles: Ukkonen’s Suffix Tree Construction – Part 1 Ukkonen’s Suffix Tree Construction – Part 2 Ukkonen’s Suffix Tree Construction – Part… Read More
This article is continuation of following four articles: Ukkonen’s Suffix Tree Construction – Part 1 Ukkonen’s Suffix Tree Construction – Part 2 Ukkonen’s Suffix Tree… Read More
This article is continuation of following three articles: Ukkonen’s Suffix Tree Construction – Part 1 Ukkonen’s Suffix Tree Construction – Part 2 Ukkonen’s Suffix Tree… Read More
This article is continuation of following two articles: Ukkonen’s Suffix Tree Construction – Part 1 Ukkonen’s Suffix Tree Construction – Part 2 Please go through… Read More
Given a 32-bit floating point number x stored in IEEE 754 floating point format, find the inverse square root of x, i.e., x-1/2.A simple solution… Read More
In Ukkonen’s Suffix Tree Construction – Part 1, we have seen high level Ukkonen’s Algorithm. This 2nd part is continuation of Part 1. Please go… Read More
Suffix Tree is very useful in numerous string processing and computational biology problems. Many books and e-resources talk about it theoretically and in few places,… Read More
MakeMyTrip recently visited our campus to hire full time employees. Here’s my interview experience: Round 1: (Online MCQs) Questions on aptitude, English, logical reasoning, C/C++… Read More
Given two positive integers n and k, print all increasing sequences of length k such that the elements in every sequence are from the first… Read More

Start Your Coding Journey Now!