Lesson 09: Collections and Data Structures

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

1/17

flashcard set

Earn XP

Description and Tags

Flashcards covering basic data structures and collections in C#, including Lists, Dictionaries, Stacks, and Queues.

Last updated 4:50 AM on 5/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

18 Terms

1
New cards

Collections

Specialized classes designed to effectively store, manage, and manipulate groups of objects, offering flexibility and advanced functionality compared to traditional data storage methods like basic arrays.

2
New cards

Arrays

Data structures that have a fixed size and do not allow dynamic resizing, which limits their flexibility in handling varying amounts of data.

3
New cards

System.Collections

A namespace in .NET that contains collections that are not generic, meaning they store items as base object types and require explicit casting when retrieving items.

4
New cards

System.Collections.Generic

A namespace in .NET that provides generic collections, utilizing type parameters (denoted as <T><T>) to ensure type safety, which leads to enhanced performance and error prevention.

5
New cards

Type-safe

A defining characteristic of generic collections which allows for type verification at compile-time by the C# compiler, thereby minimizing runtime errors such as InvalidCastException.

6
New cards

Boxing and Unboxing

Performance-intensive operations that convert value types to reference types and vice versa; these are mitigated through the use of generic collections, resulting in better efficiency.

7
New cards

List

A dynamic, strongly-typed generic collection that allows storage of a variable number of objects that can be accessed via their index and automatically resizes itself as needed.

8
New cards

Dictionary

A key-value pair collection that is strongly typed, where each key must be unique serving as an index for fast data retrieval, thus managing data efficiently.

9
New cards

Fast Lookup

An inherent feature of a Dictionary that allows for near-instantaneous retrieval of values using keys, typically operating in constant time, O(1)O(1), which greatly surpasses the speed of linear search methods.

10
New cards

ContainsKey()

A method that checks for the presence of a specific key within a Dictionary; this technique ensures that attempts to access a value associated with that key are valid.

11
New cards

TryGetValue()

A method that safely retrieves a value from a Dictionary without generating a KeyNotFoundException if the key does not exist, thereby enhancing code reliability.

12
New cards

Stack

A type of collection that organizes its elements in a Last-In, First-Out (LIFO) manner, making the most recently added element the first to be removed.

13
New cards

Push(T item)

An operation that adds a new object to the top of a Stack, increasing the stack size and preparing it for the next access.

14
New cards

Pop()

An operation that removes and returns the object at the top of a Stack, thereby reducing the size of the stack.

15
New cards

Queue

A collection that maintains its items in a First-In, First-Out (FIFO) sequence, ensuring that the first element added is the first to be removed.

16
New cards

Enqueue(T item)

A method used to add an element to the end of a Queue, allowing for orderly data processing.

17
New cards

Dequeue()

A method that removes and returns the element at the front of a Queue, facilitating the FIFO order of operations.

18
New cards

Peek()

A method that retrieves the object at the top of a Stack or the front of a Queue without removing it, allowing for examination of its value.