Improved Algorithms for the K-Maximum Subarray Problem

  • Authors:
  • Sung Eun Bae;Tadao Takaoka

  • Affiliations:
  • *Corresponding author: seb43@student.canterbury.ac.nz;Department of Computer Science and Software Engineering, University of Canterbury Christchurch, New Zealand

  • Venue:
  • The Computer Journal
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The maximum subarray problem is to find the contiguous array elements having the largest possible sum. We extend this problem to find K maximum subarrays. For general K maximum subarrays where overlapping is allowed, Bengtsson and Chen presented $$O\left(\mathit{min}\right\{K+n{\hbox{ log }}^{2}n,n\sqrt{K}\left\}\right)$$ time algorithm for one-dimensional case, which finds unsorted subarrays. Our algorithm finds K maximum subarrays in sorted order with improved complexity of O ((n + K) log K). For the two-dimensional case, we introduce two techniques that establish O(n3) and subcubic time.