max_subarray_sum/
lib.rs

1//! # max_subarray_sum
2//!
3//! Finds maximum subarray sum in a list. This is also known
4//! as max sum contigious subarray. If there are multiple such
5//! subarrays, only the one that comes first is selected.
6//!
7//! The algorithm has time complexity of `O(N)` and space complexity
8//! of `O(1)`.
9//!
10//! # Quick Start
11//! ```
12//! use max_subarray_sum::Elements;
13//!
14//! let list = vec![-2, -3, 4, -1, -2, 1, 5, -3];
15//! 
16//! //Or you can use an array instead:
17//! let list = [-2, -3, 4, -1, -2, 1, 5, -3];
18//!
19//! let elements = Elements::new(&mut list);
20//!
21//! let max_sum = elements.find_max_sum().result();
22//!
23//! assert_eq!(7, max_sum);
24//! ```
25pub mod interface;