You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/implement-collection-types/7-knowledge-check.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,9 @@ quiz:
40
40
explanation: "Incorrect. `HashSet<Account>` ensures uniqueness but doesn't support key-based look-up, which is required in this scenario."
41
41
- content: "Which of these collections in C# supports dynamic resizing and access to elements by index?"
42
42
choices:
43
-
- content: "List<T>"
43
+
- content: "`List<T>`"
44
44
isCorrect: true
45
-
explanation: "Correct. List<T> supports dynamic resizing and allows access to elements by their index, making it versatile for various scenarios."
45
+
explanation: "Correct. `List<T>` supports dynamic resizing and allows access to elements by their index, making it versatile for various scenarios."
46
46
- content: "`Dictionary<TKey, TValue>`"
47
47
isCorrect: false
48
48
explanation: "Incorrect. `Dictionary<TKey, TValue>` stores elements as key/value pairs and doesn't provide index-based access."
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/implement-collection-types/includes/3-implement-ordered-collections-typed-list.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Ordered collections in C#, such as the `List<T>` class, perform common operations like adding, removing, and iterating through items. An example where `List<T>` is managing a list of students or books.
2
2
3
-
## Use List<T> for managing ordered collections
3
+
## Use `List<T>` for managing ordered collections
4
4
5
5
`List<T>` is a generic collection designed for scenarios where you need to store and manage an ordered sequence of elements of a specific type (`T`). It provides type safety, better performance, and flexibility compared to non-generic collections like `ArrayList`, eliminating the need for type casting when accessing elements.
6
6
@@ -16,7 +16,7 @@ Ordered collections in C#, such as the `List<T>` class, perform common operation
16
16
> [!NOTE]
17
17
> `List<T>` automatically expands its capacity when needed, but this expansion can affect performance. To optimize, set an initial capacity based on the estimated size of the collection.
18
18
19
-
## Add, remove, and iterate through items in a List<T>
19
+
## Add, remove, and iterate through items in a `List<T>`
20
20
21
21
`List<T>` provides methods for adding, removing, and iterating through items efficiently. These operations are straightforward and commonly used in application development.
22
22
@@ -49,7 +49,7 @@ This example demonstrates how to add items to a `List<T>` while preserving exist
49
49
> [!TIP]
50
50
> LINQ queries can simplify filtering, ordering, and grouping operations on `List<T>`.
51
51
52
-
## Manage a list of students or books by using List<T>
52
+
## Manage a list of students or books by using `List<T>`
53
53
54
54
`List<T>` is ideal for managing collections of objects, such as students or books. You can define a custom class for the items and apply `List<T>` to store and manipulate them.
0 commit comments