no-adjacent

Crates.iono-adjacent
lib.rsno-adjacent
version0.1.1
sourcesrc
created_at2021-09-27 06:22:08.5983
updated_at2021-09-28 02:27:37.55553
descriptionMax sum when no two elements are adjacent in a list.
homepage
repositoryhttps://codeberg.org/ino/rusty-algos/src/branch/master/problems/no-adjacent
max_upload_size
id456827
size3,185
Tausif (tausifcreates)

documentation

https://docs.rs/no-adjacent

README

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

Commit count: 0

cargo fmt