简体   繁体   中英

Data Structure used for C#'s Dictionary.KeyCollection

I want to hold a list of strings which performs well when searching for a specific element. As mentioned in the following cheat sheet, Dictionary scales best for this type of operation: http://courses.essex.ac.uk/ce/ce318/www/documents/references/cSharpDataStructuresCheatSheet.pdf However, I don't need a dictionary as I'm only storing strings, not key value pairs (ie I'm only interested in the keys). Does anyone know what data structure the dictionary uses for its keys? KeyCollection seems to only be available to Dictionary. My guess is it's using some sort of hashing algorithm, but wondered if anyone had any insight on this? Thanks in advance.

您可以使用HashSet<string>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM