DEV Community

Discussion on: What is your favourite data structure?

Collapse
 
dotjargon profile image
DotJARgon

Personally I love hashmaps, they are an elegant way to quickly and efficiently store unsorted data in an organized fashion. I typically use them in situations such as spatial hashing, which makes many of my collision based algorithms so much more efficient. I also use them for situations where I need only one of each type, as hashmaps can only have a single key to value relationship. Overall their O(1) nature and their intrinsic properties make them a favorite for me!