Global Information Lookup Global Information

Maximum subarray problem information


Visualization of how sub-arrays change based on start and end positions of a sample. Each possible contiguous sub-array is represented by a point on a colored line. That point's y-coordinate represents the sum of the sample. Its x-coordinate represents the end of the sample, and the leftmost point on that colored line represents the start of the sample. In this case, the array from which samples are taken is [2, 3, -1, -20, 5, 10].

In computer science, the maximum sum subarray problem, also known as the maximum segment sum problem, is the task of finding a contiguous subarray with the largest sum, within a given one-dimensional array A[1...n] of numbers. It can be solved in time and space.

Formally, the task is to find indices and with , such that the sum

is as large as possible. (Some formulations of the problem also allow the empty subarray to be considered; by convention, the sum of all values of the empty subarray is zero.) Each number in the input array A could be positive, negative, or zero.[1]

For example, for the array of values [−2, 1, −3, 4, −1, 2, 1, −5, 4], the contiguous subarray with the largest sum is [4, −1, 2, 1], with sum 6.

Some properties of this problem are:

  1. If the array contains all non-negative numbers, then the problem is trivial; a maximum subarray is the entire array.
  2. If the array contains all non-positive numbers, then a solution is any subarray of size 1 containing the maximal value of the array (or the empty subarray, if it is permitted).
  3. Several different sub-arrays may have the same maximum sum.

Although this problem can be solved using several different algorithmic techniques, including brute force,[2] divide and conquer,[3] dynamic programming,[4] and reduction to shortest paths, a simple single-pass algorithm known as Kadane's algorithm solves it efficiently.

  1. ^ Bentley 1989, p. 69.
  2. ^ Bentley 1989, p. 70.
  3. ^ Bentley 1989, p. 73.
  4. ^ Bentley 1989, p. 74.

and 12 Related for: Maximum subarray problem information

Request time (Page generated in 0.8573 seconds.)

Maximum subarray problem

Last Update:

science, the maximum sum subarray problem, also known as the maximum segment sum problem, is the task of finding a contiguous subarray with the largest...

Word Count : 2155

Joseph Born Kadane

Last Update:

medicine, political science, sociology, computer science (see maximum subarray problem), archaeology, and environmental science, among others. He has...

Word Count : 476

Counting sort

Last Update:

the maximum key size is significantly smaller than the number of data items, counting sort may be parallelized by splitting the input into subarrays of...

Word Count : 1591

Ulf Grenander

Last Update:

University Uppsala University Known for Sieve estimation Pattern theory Maximum subarray problem Computational anatomy Awards Royal Swedish Academy of Sciences...

Word Count : 747

Shellsort

Last Update:

for practical applications. If the maximum input size is small, as may occur if Shellsort is used on small subarrays by another recursive sorting algorithm...

Word Count : 3436

List of algorithms

Last Update:

supersequence problem: Find the shortest supersequence that contains two or more sequences as subsequences Kadane's algorithm: finds the contiguous subarray with...

Word Count : 7800

Active electronically scanned array

Last Update:

and PESA can also be found, consisting of subarrays that individually resemble PESAs, where each subarray has its own RF front end. Using a hybrid approach...

Word Count : 5308

Binary search

Last Update:

case, the middle element of the left subarray ([1, 2, 3, 4, 5]) is 3 and the middle element of the right subarray ([7, 8, 9, 10, 11]) is 9. Uniform binary...

Word Count : 9632

External sorting

Last Update:

approximately equally sized subarrays, each of whose elements are all smaller than the next, and then recurse until the sizes of the subarrays are less than the...

Word Count : 2149

Estimation of signal parameters via rotational invariance techniques

Last Update:

Example of separation into subarrays (2D ESPRIT)...

Word Count : 2843

Prefix sum

Last Update:

structure based on prefix sums for computing sums of arbitrary rectangular subarrays. This can be a helpful primitive in image convolution operations. Counting...

Word Count : 5242

Goodyear MPP

Last Update:

silicon-on-sapphire LSI chip which contained eight of the PEs as a 2x4 subarray. Each of the PEs had arithmetic and logic units, 35 shift registers, and...

Word Count : 1156

PDF Search Engine © AllGlobal.net