Question d’entretien chez Nagwa

Differences between List and Dictionary and O(1) notation.

Réponse à la question d'entretien

Utilisateur anonyme

16 févr. 2021

Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace. Dictionary is a generic type and returns an error if you try to find a key which is not there. List collection is a generic class and can store any data types to create a list. Dictionary in principle has a faster lookup with O(1) while the lookup performance of a List is an O(n) operation.