C# C# Collections Sets and Dictionaries Dictionary Keys and Values

Radu - Adrian Buha
Radu - Adrian Buha
Pro Student 4,504 Points

Is there an error at 0:21 in this tutorial?

Did Jeremy made a mistake at 0:21 where he said "In fact finding the key for a value can be much slower than searching an array."? Shouldn't it be the other way around? I mean "Finding a value in a dictionary is slower than searching an array" ?

Thanks, Radu

1 Answer

Steven Parker
Steven Parker
172,167 Points

What he says is correct, but what you're saying is correct also. In fact, "finding the key for a value (in a dictionary)" is essentially the same thing as "Finding a value in a dictionary".

So "finding the key for a value" would involve finding the value, at which point you would have identified the key that goes with it.