Results for “Maps & sets”
Small, practical examples. Search by task or narrow things down below.
Iterate over keys in sorted order
Iterate over keys in sorted order in a complete Rust program using the standard library.
Rust✓ Tested
Query an ordered map’s key range
Query an ordered map’s key range in a complete Rust program using the standard library.
Rust✓ Tested
Remove an entry and inspect its value
Remove an entry and inspect its value in a complete Rust program using the standard library.
Rust✓ Tested
Represent a set with empty structs
Represent a set with empty structs using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort map keys for stable output
Sort map keys for stable output using a complete Go program with explicit sample inputs.
Go✓ Tested
Update an existing map value
Update an existing map value in a complete Rust program using the standard library.
Rust✓ Tested
Find shared members of two sets
JavaScript: Filter one set through the other set’s membership test.
JavaScript✓ Tested
Find shared members of two sets
TypeScript: Filter one set through the other set’s membership test.
TypeScript✓ Tested
Find the common members of two sorted sets
C++: set_intersection requires both input ranges to be sorted under the same comparator.
C++✓ Tested
Generate every combination of two sets
SQL: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQL✓ Tested
Generate every combination of two sets
SQL Server: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQL Server✓ Tested
Generate every combination of two sets
Postgres: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
Postgres✓ Tested