MCPcopy Create free account
hub / github.com/EbTech/rust-algorithms / first_negative

Function first_negative

src/range_query/static_arq.rs:143–158  ·  view source on GitHub ↗

An example of binary search to find the first position whose element is negative. In this case, we use RMQ to locate the leftmost negative element. To ensure the existence of a valid root note (i == 1) from which to descend, the tree's size must be a power of two.

(arq: &mut StaticArq<super::specs::AssignMin>)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

test_binary_search_rmqFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by 2

test_binary_search_rmqFunction · 0.56