Перейти к содержимому

Intro to C# - Basic Collections

Milovan Novakovic

0:00 / 0:00

Intro to C# - Basic Collections

156 просмотров · 3 нед. назад
Milovan Novakovic
269 подписчиков
156 просмотров · 3 нед. назад
Master the essential C# collections every programmer needs to know! In this tutorial, we break down how to store, manage, and manipulate data efficiently using Arrays, Lists, Sorted Lists, and Dictionaries in C#. Whether you are just getting started with C# or looking to refresh your understanding of data structures, you will learn the syntax, key differences, common exceptions (like IndexOutOfRangeException), and performance considerations when choosing the right collection. 📌 What You’ll Learn: • Why collections are essential and how to avoid variable clutter • Arrays: Declaration, indexing, initialization syntax, and bounds checking • Lists: Dynamic sizing, adding/removing items, and performance trade-offs • SortedList: Storing and ordering key-value pairs • Dictionaries: Fast lookups, handling unique keys, and using TryGetValue safely ⏱️ Timestamps: 00:09 - Introduction: Why Use Collections? 01:03 - C# Arrays: Syntax & Zero-Based Indexing 02:14 - Array Bounds & IndexOutOfRangeException 02:59 - Quick Array Initialization Syntax 04:26 - Introduction to Lists 05:17 - Adding & Accessing List Elements 06:37 - Removing Elements & Performance Impact 08:11 - Using SortedList (Key-Value Pairs) 10:04 - Dictionaries 11:38 - Safe Lookups with TryGetValue 12:17 - Summary & Next Steps 💬 Have questions about when to use a List vs. a Dictionary? Drop a comment below! 👍 If this helped you write cleaner C# code, please like the video and subscribe for more programming tutorials!