Results for “Queues & collection operations”
Small, practical examples. Search by task or narrow things down below.
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Count occurrences in a list
Count how often each value appears using Counter from the standard library.
count✓ Tested
Count word frequencies
Use Map.merge to count repeated words in Java.
Java✓ Tested
Count word frequencies
Accumulate word counts in an ordered C++ map.
C++✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Count words with GroupBy
Group repeated C# words and print ordered counts.
C#✓ Tested
Filter a list with a condition
Build a new list containing only the values that satisfy a condition using a list comprehension.
list✓ Tested
Filter and transform an array
Keep active objects and extract their names.
filter✓ Tested
Filter even numbers
Use LINQ Where to keep even C# values.
C#✓ Tested
Filter even numbers
Use a Java stream to collect only even values.
Java✓ Tested
Filter items in a pipeline
Keep numbers that meet a condition.
Where-Object✓ Tested
Join several strings with a separator
PowerShell: The join operator returns one string from an input collection.
PowerShell✓ Tested