no-adjacent 0.1.1

Max sum when no two elements are adjacent in a list.
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented1 out of 1 items with examples
  • Size
  • Source code size: 3.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 248.74 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tausifcreates ghost_115582

no_adjacent

Finds Maximum sum when no two elements are adjacent in a list.

Time complexity O(N), Space complexity O(1).

Quick Start

use no_adjacent::interface::calculate;

fn main() {
    let list = [2, 1, 4, 6, 8, 9, 18];

    let sum = calculate(&list);

    println!("sum {}", sum); // 32
}

version note: Fix a stupid design