## 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 »

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

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

## Modular exponentiation (Recursive)

Given three numbers a, b and c, we need to find (ab) % c Now why do “% c” after exponentiation, because ab will be… Read More »

## Java 8 | Arrays parallelSort() method with Examples

Java 8 introduced a new method called as parallelSort() in java.util.Arrays Class. It uses Parallel Sorting of array elements Algorithm of parallelSort() 1. The array… Read More »

## Search equal, bigger or smaller in a sorted array in Java

Given array of sorted integer, search key and search preferences find array position. A search preferences can be: 1) EQUAL – search only for equal… Read More »

## Merge Sort with O(1) extra space merge and O(n lg n) time

We have discussed Merge sort. How to modify the algorithm so that merge works in O(1) extra space and algorithm still works in O(n Log… Read More »

## Sudo Placement | Placement Tour

Given an array A of N positive integers and a budget B. Your task is to decide the maximum number of elements to be picked… Read More »