Results for “Vectors & slices”
Small, practical examples. Search by task or narrow things down below.
Append several values to a vector
Append several values to a vector in a complete Rust program using the standard library.
Rust✓ Tested
Inspect overlapping windows
Inspect overlapping windows in a complete Rust program using the standard library.
Rust✓ Tested
Keep only values satisfying a condition
Keep only values satisfying a condition in a complete Rust program using the standard library.
Rust✓ Tested
Process a slice in bounded chunks
Process a slice in bounded chunks in a complete Rust program using the standard library.
Rust✓ Tested
Remove and collect a vector range
Remove and collect a vector range in a complete Rust program using the standard library.
Rust✓ Tested
Search a sorted slice
Search a sorted slice in a complete Rust program using the standard library.
Rust✓ Tested
Sort a vector in ascending order
Sort a vector in ascending order in a complete Rust program using the standard library.
Rust✓ Tested
Sort and remove repeated values
Sort and remove repeated values in a complete Rust program using the standard library.
Rust✓ Tested
Split a slice into two parts
Split a slice into two parts in a complete Rust program using the standard library.
Rust✓ Tested
Calculate the dot product of two vectors
C++: inner_product multiplies corresponding elements and accumulates them from a chosen seed.
C++✓ Tested
Join string slices
Join string slices in a complete Rust program using the standard library.
Rust✓ Tested
Copy a slice without sharing storage
Copy a slice without sharing storage using a complete Go program with explicit sample inputs.
Go✓ Tested