Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

# Median in a stream of integers (running integers)

Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no duplicates. For example, let...

# Write a program to reverse an array or string

Given an array (or string), the task is to reverse the array/string. Examples : Input : arr[] = {1, 2, 3} Output : arr[] = {3, 2, 1} Input : arr[] = {4, 5, 1, 2} ...

# Sort an array of 0s, 1s and 2s

Given an array A[] consisting 0s, 1s and 2s, write a function that sorts A[]. The functions should put all 0s first, then all 1s and all 2s in last. Examples: Input :...

# QuickSort

Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many di...

# HeapSort

Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element and pl...

# Check if a number is Bleak

A number &#x2018;n&#x2019; is called Bleak if it cannot be represented as sum of a positive number x and set bit count in x, i.e., x + countSetBits(x) is not equal to...

# Minimum number of jumps to reach end

Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a function to return the minimum n...

# Maximize the sum of arr[i]*i

Given an array of N integers. You are allowed to rearrange the element of the array. The task is to find the maximum value of &#x3A3;arr[i]*i, where i = 0, 1, 2,&#x20...

# GCD of more than two (or array) numbers

Given an array of numbers, find GCD of the array elements. In a previous post we find GCD of two number. Examples: Input : arr[] = {1, 2, 3} Output : 1 Input : arr...

# Program to find LCM of two numbers

LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example LCM of 15 and 20 is 60 and LCM of 5 and 7 is 35. ...