Dictionary (C#)

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:53 AM on 8/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

29 Terms

1
New cards

Dictionary

A generic collection in System.Collections.Generic that stores associations between unique keys and values, allowing values to be accessed through their corresponding keys. Domain: C# → .NET → System.Collections.Generic → Dictionary

2
New cards

TKey

The generic type parameter in Dictionary

3
New cards

TValue

The generic type parameter in Dictionary

4
New cards

Key-Value Pair

An association in which a unique key identifies and provides access to a corresponding value.

5
New cards

new Dictionary

Creates an empty Dictionary

6
New cards

Dictionary Initializer

Syntax that creates a Dictionary and supplies its initial key-value entries inside braces.

7
New cards

dictionary.Count

Gets the number of key-value pairs currently stored in the Dictionary.

8
New cards

dictionary[key]

Gets or sets the value associated with the specified key.

9
New cards

Dictionary Key

A value used to uniquely identify and retrieve an associated value from a Dictionary.

10
New cards

Dictionary Value

The data associated with a particular key; unlike keys, duplicate values are allowed.

11
New cards

Unique Dictionary Keys

A Dictionary cannot contain multiple entries with equal keys according to its key comparer.

12
New cards

Duplicate Dictionary Values

A Dictionary may contain multiple different keys that are associated with equal values.

13
New cards

dictionary.Add(key, value)

Adds a key and its associated value to the Dictionary and throws an exception if an equivalent key already exists.

14
New cards

dictionary[key] = value

Adds a new key-value association if the key does not exist, or replaces the value associated with an existing key.

15
New cards

dictionary.TryAdd(key, value)

Attempts to add a key-value pair and returns false rather than throwing because the key already exists.

16
New cards

dictionary.ContainsKey(key)

Determines whether the Dictionary contains the specified key.

17
New cards

dictionary.ContainsValue(value)

Determines whether the Dictionary contains at least one entry with the specified value.

18
New cards

dictionary.TryGetValue(key, out value)

Attempts to retrieve the value associated with a key and reports whether the key was found.

19
New cards

dictionary.Remove(key)

Removes the entry associated with the specified key and reports whether the key was found and removed.

20
New cards

dictionary.Clear()

Removes all key-value pairs from the Dictionary.

21
New cards

dictionary.Keys

Gets a collection containing the keys stored in the Dictionary.

22
New cards

dictionary.Values

Gets a collection containing the values stored in the Dictionary.

23
New cards

dictionary.Comparer

Gets the equality comparer used to determine whether dictionary keys are equal.

24
New cards

KeyNotFoundException

The exception typically thrown when the Dictionary indexer is used to retrieve a key that does not exist.

25
New cards

ArgumentException on Add

Dictionary.Add throws an ArgumentException when an equivalent key already exists in the Dictionary.

26
New cards

Dictionary Lookup

A Dictionary is designed for efficient retrieval of values by key rather than retrieval by a sequential numeric position.

27
New cards

Dictionary Enumeration

Enumerating a Dictionary produces KeyValuePair

28
New cards

Dictionary vs List

List organizes elements primarily by zero-based position, whereas Dictionary

29
New cards

Dictionary Does Not Guarantee Positional Indexing

A Dictionary key is an identifier used for lookup and should not be confused with the zero-based positional index used by List.