HACKER Q&A
📣 ghoshbishakh

What is your favourite data structure and why?


Apart from the well known ones, have you come across any very useful data structure which is not yet mainstream?


  👤 keyP Accepted Answer ✓
I've not had any particular reason to specifically use this but I found Robin Hood Hashing to be quite an interesting concept. It improves performance by essentially reducing the distance from the key to its matching key-value pair.

Advantages listed from [3]:

- The number and variance of look-ups are reduced

- Searches can be ended early, since 'hits' are found much quicker

- The flat array structure eliminates need for linked lists or pointers: reduces misses and overhead

- Even finding non-existent elements is fast

- This method approaches O(1), meaning the most efficient search

[1]Part 1: https://www.sebastiansylvan.com/post/robin-hood-hashing-shou...

[2]Part 2 (slight update based on suggestions in part 1's comment): https://www.sebastiansylvan.com/post/more-on-robin-hood-hash...

[3]https://study.com/academy/lesson/robin-hood-hashing-concepts...


👤 techstrategist
If I could broaden the question - what have you found useful of the well-known data structures that a self-taught dev may not be fully aware of?