## Find element position in given monotonic sequence

Given an integer k and a monotonic increasing sequence: f(n) = an + bn [log2(n)] + cn^3 where (a = 1, 2, 3, …), (b… Read More »

## Largest perfect square number in an Array

Given an array of n integers. The task is to find the largest number which is a perfect square. Print -1 if there is no… Read More »

## Search in a sorted 2D matrix (Stored in row major order)

Given an integer ‘K’ and a row-wise sorted 2-D Matrix i.e. the matrix has the following properties: Integers in each row are sorted from left… Read More »

## Numbers that are bitwise AND of at least one non-empty sub-array

Given an array ‘arr’, the task is to find all possible integers each of which is the bitwise AND of at least one non-empty sub-array… Read More »

## Queries to check whether a given digit is present in the given Range

Pre-requisites: Segment Tree Given an array of digits arr[]. Given a number of range [L, R] and a digit X with each range. The task… Read More »

## Kth Smallest sum of continuous subarrays of positive numbers

Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More »

## Binary Search In JavaScript

Binary Search is searching technique which works on Divide and Conquer approach. It used to search any element in a sorted array. As compared to… Read More »

## Find Nth term (A matrix exponentiation example)

We are given a recursive function that describes Nth terms in form of other terms. In this article we have taken specific example. Now you… Read More »

## Binary Search (bisect) in Python

Binary Search is a technique used to search element in a sorted list. In this article, we will looking at library functions to do Binary… Read More »

## Quick Sort vs Merge Sort

Prerequisite :Merge Sort and Quick Sort Quick sort is an internal algorithm which is based on divide and conquer strategy. In this: The array of… Read More »

## Number of ways to divide a given number as a set of integers in decreasing order

Given two numbers and . The task is to find the number of ways in which a can be represented by a set such that… Read More »

## Dynamic Programming vs Divide-and-Conquer

TL;DR In this article I’m trying to explain the difference/similarities between dynamic programing and divide and conquer approaches based on two examples: binary search and… Read More »

## Cut all the rods with some length such that the sum of cut-off length is maximized

Given N rods of different lengths. The task is to cut all the rods with some maximum integer height ‘h’ such that sum of cut-off… Read More »

## Find the Missing Number in a sorted array

Given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in list. One of… Read More »

## First strictly smaller element in a sorted array in Java

Given a sorted array and a target value, find the first element that is strictly smaller than given element. Examples: Input : arr[] = {1,… Read More »