FIND YOUR NEXT FEW LINES

Results for “Queues & collection operations”

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

312 snippets foundClear filters
PowerShellFunctions & control

Transform each item in a collection

Build a result array with a foreach expression.

foreach✓ Tested
PythonGetting Started

Visit every item in a collection

Python: Print each element in the collection’s original order.

Python✓ Tested
C#Getting Started

Visit every item in a collection

C#: Print each element in the collection’s original order.

C#✓ Tested
JavaGetting Started

Visit every item in a collection

Java: Print each element in the collection’s original order.

Java✓ Tested
JavaScriptGetting Started

Visit every item in a collection

JavaScript: Print each element in the collection’s original order.

JavaScript✓ Tested
TypeScriptGetting Started

Visit every item in a collection

TypeScript: Print each element in the collection’s original order.

TypeScript✓ Tested
C++Getting Started

Visit every item in a collection

C++: Print each element in the collection’s original order.

C++✓ Tested
CGetting Started

Visit every item in a collection

C: Print each element in the collection’s original order.

C✓ Tested
jQueryInsertion & wrapping

Wrap a collection in one shared parent

jQuery: wrapAll places all selected elements inside one wrapper.

jQuery✓ Tested
PowerShellArray operations

Pair corresponding values from two arrays

PowerShell: Check lengths before indexing to reject mismatched input collections.

PowerShell✓ Tested
C#Collections & data structures

Use a last-in first-out stack

C#: Stack is useful for reversible traversal and other nested operations.

C#✓ Tested
C#Collections & data structures

Add a dictionary entry only if absent

C#: TryAdd reports a duplicate key without replacing its existing value.

C#✓ Tested