Browse by Topic

Popular

Latest

Latest C# Posts

Comparison of C# Dictionary and SortedDictionary with a hash table on the left and a sorted tree on the right
C#

C# Dictionary vs SortedDictionary: Which to Use?

Compare C# Dictionary and SortedDictionary: ordering guarantees, lookup performance, memory behavior, and practical guidance for choosing between them.

DictionarySortedDictionaryC# CollectionsPerformance
Illustration of a C# SortedSet maintaining unique elements in ascending order with a custom comparer.
C#

C# SortedSet Usage: Ordered Set in .NET

Learn how to use C# SortedSet<T> for ordered, unique collections: creation, operations, custom comparers, and performance tradeoffs.

SortedSetC# Collections.NETData Structures
Diagram of a SortedDictionary showing sorted keys and value pairs in C#
C#

C# SortedDictionary Usage: Ordering and Performance

Learn how to use C# SortedDictionary for automatically ordered key-value storage, including custom comparers, performance tradeoffs, common pitfalls, and when to choose it over SortedList or Dictionary.

SortedDictionaryC# CollectionsOrderingComparer
Illustration of a sorted list in C# showing key-value pairs arranged in ascending order with an index pointer
C#

C# SortedList Usage: Sorting Key-Value Pairs Efficiently

c# sortedlist usage: Learn how to use SortedList<TKey, TValue> in C#: creation, insertion, lookup, iteration, and when to prefer it over SortedDictionary.

SortedListCollectionsC#Dictionaries
Flat illustration comparing a contiguous array of squares for List<T> with a chain of linked nodes for LinkedList<T> in C#.
C#

C# List vs LinkedList: When the Difference Matters

Compare C# List<T> and LinkedList<T> on storage, indexing, insertion cost, and memory behavior to choose the right collection for your workload.

List<T>LinkedList<T>Data StructuresPerformance
Diagram of a doubly linked list showing nodes with previous and next pointers, representing LinkedListNode in C#
C#

Working with LinkedListNode in C#

Learn how to use LinkedListNode<T> in C# to traverse, insert, and remove nodes in a LinkedList. Includes code examples, performance tradeoffs, and common pitfalls.

LinkedListLinkedListNodeC# CollectionsData Structures
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