Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Radu - Adrian Buha
PLUS
Radu - Adrian Buha
Courses Plus Student 5,535 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
231,198 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.