Index-based Input/Output — in which of the following .NET collections are elements accessed by index?

Difficulty: Easy

Correct Answer: BitArray and ArrayList

Explanation:


Introduction / Context:
Different collection types expose different access patterns (index, key, FIFO, LIFO). This affects algorithm design and complexity.



Concept / Approach:
ArrayList and BitArray are index-based. Stack (LIFO) and Queue (FIFO) do not expose random indexers. HashTable is key-based, not index-based.



Why Other Options Are Wrong:
Options including Stack/Queue/HashTable imply index-based access where none exists.



Final Answer:
BitArray and ArrayList

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion