H2. Collections and Generics

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

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

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

No analytics yet

Send a link to your students to track their progress

43 Terms

1
New cards

Collections

What is a group of objects that provides a standard set of types for storing and managing collections of objects?

2
New cards

Collections

Which contains lists, linked lists, dictionaries, and arrays to manage collections of objects?

3
New cards
  1. Standard Collections

  2. Generic Collections


What are the two types of collections?

4
New cards

Standard Collections

Which are found in the System.Collections namespace?

5
New cards

Generic Collections

Which are found in the System.Collections.Generic namespace?

6
New cards
  1. ArrayList

  2. Hashtable

  3. SortedList

  4. Stack

  5. Queue


What are Classes of the System.Collections Namespace?

7
New cards

ArrayList

Which collection class is known for an ordered collection of objects?

8
New cards

ArrayList

Which is not the same as an array that is static in size?

9
New cards

ArrayList

Which is known as dynamic since items can be added and removed from the specified index location?

10
New cards

Hashtable

Which class stores key or value pairs where the key represents the value in the collection?

11
New cards

Hashtable

When accessing the values in […], the key must be specified.

12
New cards

SortedList

Which class is a combination of ArrayList and Hashtable?

13
New cards

SortedList

Which class stores key or value pairs where the key values sort values?

14
New cards

SortedList

To access the values in […], the key or index value must be specified.

15
New cards
  1. Capacity

  2. Count

  3. Item

  4. Key

  5. Values


What are some properties that can be used in SortedList?

16
New cards

Capacity

Which property gets or sets the capacity of SortedList?

17
New cards

Count

Which property gets the count of the number of elements in SortedList?

18
New cards

Item

Which property gets and sets the value associated with a specific key in the SortedList?

19
New cards

Keys

Which property carry the keys in the SortedList?

20
New cards

Values

Which property carry the values in the SortedList?

21
New cards
  1. void Clear()

  2. void Add(object key, object value)

  3. void Remove(object key)

  4. void RemoveAt(int index)

  5. bool ContainsKey(object key)

  6. bool ContainsValue(object value)

  7. object GetByIndex(int index)

  8. object GetKey(int index)


What are some methods that are used in SortedList?

22
New cards

void Clear()

Which method is used to remove all the items in the SortedList?

23
New cards

void Add(object key, object value)

Which method adds an item with the specified key and value into the SortedList?

24
New cards

void Remove(object key)

In the SortedList, a key that is specified will remove its element.

25
New cards

void RemoveAt(int index)

It is an index that is specified will remove its element in the SortedList.

26
New cards

bool ContainsKey(object key)

If the SortedList contains specified key, then it will return the Boolean value true.

27
New cards

bool ContainsValue(object value)

If the SortedList contains specified value, then it will return the Boolean value true.

28
New cards

object GetByIndex(int index)

Which method returns the value of the specified index in SortedList?

29
New cards

object GetKey(int index)

Which method returns the key of the specified index in the SortedList?

30
New cards

Stack

Which class represents a Last In, First Out (LIFO) collection of objects?

31
New cards

push and pop

When inserting and removing objects from the stack, it uses […] and […] operations.

32
New cards

Queue

Which class represents a First In, First Out (FIFO) collection of objects?

33
New cards

enqueue and dequeue

Adding and removing objects from the queue class uses an […] and […] operations.

34
New cards
  1. IEnumerable

  2. ICollection

  3. IDictionary


What are the Interfaces in the System.Collections Namespace?

35
New cards

IEnumerable

Which interface allows you to loop through elements in a collection?

36
New cards

ICollection

Which interface allows you to determine the number of elements in a collections and copy them in a simple array type?

37
New cards

IDictionary

Which interface provides a list of elements that are accessible via a key or value rather than an index?

38
New cards

Generics

What makes the code reusable across different types by creating a template that contains placeholder types?

39
New cards

Generics

What allows specifying the data types of the programming elements when they are actually used in the program?

40
New cards

System.Collection.Generics namespace

Which contains several generic collection classes?

41
New cards

Generics

When using […], it allows creating collections like linked lists, hashtables, stacks and queues that operate on an item of any data type?

42
New cards
  1. List<T>

  2. Queue<T>

  3. Stack<T>


What are the generic collections found in System.Collections.Generic namespace?

43
New cards

List<T>

Which is a generic collection that provides an efficient and dynamically allocated array—also commonly used to store a list of duplicate objects?