Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

Illustration of removing a node from a linked list in C#, showing two nodes reconnecting after the middle node is deleted.
C#

C# LinkedList Remove: Delete Nodes Efficiently

c# linkedlist remove: Learn how to remove elements from a LinkedList<T> in C#. Understand O(1) node removal, O(n) value search, and when LinkedList beats List.

LinkedListC# CollectionsRemove OperationsPerformance
Diagram of a linked list with nodes added at head and tail using AddFirst and AddLast.
C#

C# LinkedList AddFirst and AddLast: Usage and Performance

Learn how to use C# LinkedList<T>.AddFirst and AddLast for O(1) insertions at both ends, including practical examples and when they beat List<T>.

LinkedListC# CollectionsAddFirstAddLast
Diagram showing a C# LinkedList<T> with nodes and pointers illustrating efficient insertion and removal operations.
C#

C# LinkedList Usage: When and How to Use LinkedList<T>

c# linkedlist usage: Understand when to use LinkedList<T> in C#. Explore node-based operations, performance tradeoffs, and practical examples for efficient insertion a...

C#LinkedListCollectionsData Structures
Illustration of a generic Stack<T> in C# showing push and pop operations with type safety.
C#

Using the C# Generic Stack<T> Effectively

Use C# generic Stack<T> for LIFO operations: construct and initialize a stack, use Push/Pop/Peek, iterate safely, understand performance, and avoid common mistakes.

C#StackGenericsCollections
Illustration comparing a stack of plates (LIFO) and a queue of people (FIFO) with arrows showing order of processing
C#

C# Stack vs Queue: Choosing the Right Collection

Understand the core differences between Stack and Queue in C#, including LIFO vs FIFO behavior, typical operations, performance, and when to use each.

C#StackQueueData Structures
Illustration of a stack data structure with a TryPeek operation returning a boolean and the top element.
C#

C# Stack.TryPeek: Safe Peek Without Exceptions

Learn how C# Stack<T>.TryPeek inspects the top element without throwing on an empty stack, with code examples and edge cases.

C#Stack.NETCollections
Illustration of a C# stack with TryPop returning a value instead of throwing an exception on an empty stack.
C#

Using Stack<T>.TryPop in C#

Learn how Stack<T>.TryPop avoids exceptions on empty stacks in C#, when to use it instead of Pop, and how ConcurrentStack<T> handles thread safety.

C#Stack<T>TryPop.NET Collections
Illustration of a stack data structure with a pointer to the top element being inspected without removal.
C#

C# Stack Peek: Inspect the Top Element Without Removing It

Learn how to use C# Stack<T>.Peek to inspect the top element without removing it, including empty stack handling, TryPeek, and performance.

C#Stack<T>PeekCollections
Illustration of a C# stack with push and pop operations showing LIFO order
C#

C# Stack Push and Pop: Practical Usage

Learn how to use Stack<T> in C# for LIFO operations. Understand Push, Pop, Peek, TryPop, performance, and common pitfalls with practical examples.

C#Stack<T>CollectionsLIFO
Illustration of a call stack with value types and stackalloc buffer in C#
C#

C# Stack Usage: Allocation, Performance, and Limits

Understand C# stack usage: call stack frames, value-type allocation, and using stackalloc safely for short-lived buffers.

stack allocationvalue typesstackallocmemory management