Week 6 Blog Post

#1
  1. What are jagged arrays?

A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays.

  1. What are some c# exceptions?

IndexOutOfRangeException - Thrown by the runtime only when an array is indexed improperly.

NullReferenceException - Thrown by the runtime only when a null object is referenced.

InvalidOperationException - Thrown by methods when in an invalid state.

ArgumentException - Base class for all argument exceptions.

ArgumentNullException - Thrown by methods that do not allow an argument to be null.

ArgumentOutOfRangeException - Thrown by methods that verify that arguments are in a given range.

  1. What is a Dictionary?

The Dictionary<TKey, TValue> Class in C# is a collection of Keys and Values. It is a generic collection class in the System.Collection.Generics namespace. The Dictionary <TKey, TValue> generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O(1) because the Dictionary class is implemented as a hash table. Every key in a Dictionary <TKey, TValue> must be unique according to the dictionary’s equality comparer.

  1. How to look for a specific key in a Dictionary?

ContainsKey method

Sources:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/jagged-arrays
https://docs.microsoft.com/en-us/dotnet/standard/exceptions/index