FIND YOUR NEXT FEW LINES

Results for “Vectors & slices”

Small, practical examples. Search by task or narrow things down below.

20 snippets foundClear filters
RustVectors & slices

Append several values to a vector

Append several values to a vector in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Inspect overlapping windows

Inspect overlapping windows in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Keep only values satisfying a condition

Keep only values satisfying a condition in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Process a slice in bounded chunks

Process a slice in bounded chunks in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Remove and collect a vector range

Remove and collect a vector range in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Search a sorted slice

Search a sorted slice in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Sort a vector in ascending order

Sort a vector in ascending order in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Sort and remove repeated values

Sort and remove repeated values in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Split a slice into two parts

Split a slice into two parts in a complete Rust program using the standard library.

Rust✓ Tested
C++Sequence algorithms

Calculate the dot product of two vectors

C++: inner_product multiplies corresponding elements and accumulates them from a chosen seed.

C++✓ Tested
RustStrings & Unicode

Join string slices

Join string slices in a complete Rust program using the standard library.

Rust✓ Tested
GoSlices & collections

Copy a slice without sharing storage

Copy a slice without sharing storage using a complete Go program with explicit sample inputs.

Go✓ Tested