Recall & Review
beginner Click to reveal answer
What does 'Array Insertion at End' mean?
It means adding a new element to the last position of an array, making the array one element larger if possible.
beginner Click to reveal answer
Why can't we always insert an element at the end of a fixed-size array?
Because fixed-size arrays have a set length and cannot grow. To insert at the end, we need space or create a new larger array.
intermediate Click to reveal answer
What is the first step to insert an element at the end of an array if the array is full?
Create a new array with a larger size, copy all elements from the old array, then add the new element at the end.
beginner Click to reveal answer
In C#, what data structure can be used instead of arrays to allow easy insertion at the end?
List<T> because it automatically resizes and allows adding elements at the end easily.
beginner Click to reveal answer
What happens if you try to insert an element at the end of an array without enough space?
You get an error or unexpected behavior because arrays have fixed size and cannot hold more elements than their length.
What is the main challenge when inserting an element at the end of a fixed-size array?
✗ Incorrect
Fixed-size arrays have a set length and cannot grow, so inserting beyond that size is not possible without creating a new array.
Which C# data structure is best for easy insertion at the end?
✗ Incorrect
List automatically resizes and allows adding elements at the end easily.
What must you do before inserting at the end if the array is full?
✗ Incorrect
You need to create a new larger array and copy existing elements before adding the new element.
What is the index of the last element in an array of length 5?
✗ Incorrect
Array indices start at 0, so the last element index is length - 1, which is 4.
If you have an array: [1, 2, 3] and insert 4 at the end, what is the new array?
✗ Incorrect
Inserting 4 at the end adds it after the last element, resulting in [1, 2, 3, 4].
Explain how to insert an element at the end of a fixed-size array in C#.
Think about array size and copying elements.
You got /4 concepts.
Describe why List is preferred over arrays for insertion at the end.
Consider flexibility and ease of use.
You got /4 concepts.
