Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Heap Mathematical Adobe

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...
Arrays Strings CBSE - Class 11

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} ...
Arrays Sorting Adobe

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 :...
Divide and Conquer Sorting Adobe

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...
Heap Sorting 24*7 Innovation Labs

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...
Bit Magic SAP Labs SAP-Labs-Question

Check if a number is Bleak

A number ‘n’ 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...
Dynamic Programming Mathematical Adobe

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...
Arrays Greedy Sorting

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 Σarr[i]*i, where i = 0, 1, 2,&#x20...
Arrays Mathematical GCD-LCM

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...
Mathematical School Programming GCD-LCM

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. ...

Subscribe to Our Newsletter