C# tutorial
Build typed applications on .NET.
Course contents
Programming fundamentals
C# Basics
Print a value from a .NET program.
C# Loops
Repeat an action with a for loop.
C# Methods
Package reusable logic in a static method.
C# strings and formatting
Use common string methods, compare text correctly, and format numbers with format specifiers.
C# exceptions, finally, and using
Throw and catch a custom exception, filter by condition, and release resources reliably.
C# nullable values, patterns, and switch expressions
Handle missing values safely and branch on the type and value of an object.
Object-oriented programming
C# Classes and Properties
Protect state with a property that only the class can change.
C# inheritance, virtual, and abstract members
Override behaviour in subclasses and call it through a base-type reference.
C# records, with-expressions, and value semantics
Create immutable data types with value equality, copy them with changes, and compare with structs and classes.
C# delegates, events, and lambdas
Pass behaviour as a value and let objects notify subscribers when something happens.
Data structures and algorithms
C# Lists
Grow a collection with List<T> and add its values.
C# Dictionary and HashSet operations
Count words with a dictionary and combine sets with union, intersection, and difference.
C# Stack and Queue: evaluating postfix expressions
Use a stack to evaluate expressions written in reverse Polish notation and a queue for first-in order.
C# sorting, stability, and Array.BinarySearch
Sort arrays and records, keep equal items in order with LINQ, and find insertion points.
C# LRU cache with Dictionary and LinkedList
Combine a hash table and a doubly linked list so that get, put, and eviction all take constant time.
C# generic binary search tree with IEnumerable
Constrain the element type with IComparable<T> and expose the sorted values with yield return.