news.volyx.in

Ask HN: What are some cool but obscure data structures you know about?

2051 points by Uptrenda · 1513 days ago · 753 comments on HN

Article summary

The article discusses interesting and lesser-known data structures, starting with bloom filters, which can efficiently test if a value is definitely not in a list of pre-stored values. Bloom filters have a unique property where their time complexity does not grow with the number of elements. The article also mentions Golomb Coded Sets, which are similar to bloom filters but have smaller storage space and worse performance. The goal is to explore other cool and obscure data structures.

Main themes

  • obscure data structures
  • bloom filters
  • monotonic stacks
  • tries and prefix trees
  • hashing vs sorting
  • caching and performance
  • disjoint-sets and union-find
  • approximate counting and indexing

What commenters say

  • Some commenters find monotonic stacks to be a deceptively simple yet useful data structure, while others question their practical applications.
  • Tries, also known as prefix trees, are considered a standard data structure by some, but others still find them interesting and useful for specific use cases.
  • The choice between tree-based and hash-based data structures depends on the specific problem and performance requirements, with some arguing that caching can make sorting and searching more efficient than hashing.
  • The Israeli queue data structure is proposed as an example of an obscure data structure, but its similarity to priority queues is debated.
  • Disjoint-sets have an extremely slow-growing amortized time complexity, making them nearly constant for practical purposes.
  • Other data structures like HyperLogLog, SkipList, and bitmap indexes are also mentioned as useful for specific tasks like approximate counting and efficient searching.
  • The discussion highlights the importance of understanding the trade-offs between different data structures and their applications.
  • Some commenters share their personal experiences and use cases for various data structures, demonstrating their practical value.