Maximum of all subarrays of size k
Given an array arr[] of size N and an integer K. Find the maximum for each and every contiguous subarray of size K.
- Time : O(nlogk)
- Space : O(k)
c++
1 | class Solution |
- Time : O(n)
- Space : O(k)
c++
1 | class Solution |