Multiple choice technology programming languages

  1. Which of the following can be used/efficient to store items(name/value pairs) in which the number of items can be less or more(not known)?

  1. Hashtable.

  2. ListDictionary.

  3. Hybrid Dictionary

  4. ArrayList.

  5. StringDictionary.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

HybridDictionary is the most efficient choice for storing name/value pairs when the quantity is unknown. It automatically uses a ListDictionary for small collections (which is efficient for few items) and switches to a Hashtable when the collection grows (which is efficient for larger collections). Hashtable is always a hash table (overhead for small collections), ListDictionary is always a linked list (slow for large collections), and ArrayList stores only values not key-value pairs.