Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Queue sliding-window

Sum of minimum and maximum elements of all subarrays of size k.

Given an array of both positive and negative integers, the task is to compute sum of minimum and maximum elements of all sub-array of size k. Examples: Input : arr[] ...
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 Stack cpp-pair

Count subarrays where second highest lie before highest

Given an array of N distinct element of at least size 2. A pair (a, b) in an array is defined as ‘a’ is the index of second smallest element and &#x2018...

Subscribe to Our Newsletter