Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
JavaScript javascript-functions javascript-typedArray

JavaScript typedArray.subarray() with Examples

The typedArray.subarray() is an inbuilt function in JavaScript which is used to return a part of the typedArray object. Syntax: typedarray.subarray(begin, end) Parame...
Arrays Sorting Arrays

Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted

Given an unsorted array arr[0..n-1] of size n, find the minimum length subarray arr[s..e] such that sorting this subarray makes the whole array sorted. Examples: 1) ...
Arrays Queue Amazon

Sliding Window Maximum (Maximum of all subarrays of size k)

Given an array and an integer k, find the maximum for each and every contiguous subarray of size k. Examples : Input : arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6} k = 3 Outp...
Arrays Arrays

Maximum Length Bitonic Subarray Set 1 (O(n) tine and O(n) space)

Given an array A[0 … n-1] containing n positive integers, a subarray A[i … j] is bitonic if there is a k with i <= k <= j such that A[i] <= A[i...
Arrays Arrays

Length of the largest subarray with contiguous elements Set 1

Given an array of distinct integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence. Examples: Input: arr...
Hash Hash

Length of the largest subarray with contiguous elements Set 2

Given an array of integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence. In the previous post, we have d...
Advanced Data Structure Bit Magic Strings

Find the maximum subarray XOR in a given array

Given an array of integers. find the maximum XOR subarray value in given array. Expected time complexity O(n). Examples: Input: arr[] = {1, 2, 3, 4} Output: 7 The su...
Arrays Divide and Conquer Dynamic Programming

Maximum Subarray Sum using Divide and Conquer algorithm

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has the largest sum....
Arrays C++ Programs Divide and Conquer

Distinct elements in subarray using Mo’s Algorithm

Given an array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task is to print the number of disti...
Arrays Dynamic Programming Arrays

Size of The Subarray With Maximum Sum

An array is given, find length of the subarray having maximum sum. Examples : Input : a[] = {1, -2, 1, 1, -2, 1} Output : Length of the subarray is 2 Explanation: Su...

Subscribe to Our Newsletter