Results for “for”
Small, practical examples. Search by task or narrow things down below.
Sort a vector in ascending order
Sort a vector in ascending order in a complete Rust program using the standard library.
Rust✓ Tested
Sort an integer array with qsort
C: The comparator uses relational comparisons to avoid subtraction overflow.
C✓ Tested
Sort and deduplicate lines
Sort lines alphabetically and remove duplicate lines in a predictable C locale.
sort✓ Tested
Sort and deduplicate values
Produce an ordered list without duplicates.
Sort-Object✓ Tested
Sort and deduplicate values
Sort a C++ vector and erase adjacent duplicates.
C++✓ Tested
Sort and remove repeated values
Sort and remove repeated values in a complete Rust program using the standard library.
Rust✓ Tested
Sort dictionaries by a value
Sort a list of dictionaries by a numeric field, leaving the original list unchanged.
sort✓ Tested
Sort integers in place
Sort integers in place using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort lines by numeric value
Linux Commands: Use sort -n so 10 sorts after 2 instead of before it.
Linux Commands✓ Tested
Sort map keys for stable output
Sort map keys for stable output using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Sort only the smallest requested prefix
C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.
C++✓ Tested