Tech News
← Home  ·  All topics

Data Structure

3 GoKawiil briefs on this topic

CP-Algorithms explains treap data structure combining BST and heap properties

The article describes the treap (cartesian tree), a data structure that stores (X,Y) pairs as a binary search tree ordered by X and a binary heap ordered by Y. It credits Raimund Seidel and Cecilia Aragon with proposing the structure in 1989, and explains that assigning random priority values yields balanced trees, giving operations like insert and search O(log N) average complexity.

Bluesky engineering details one-hash bloom filter design for Scylla lookups

Bluesky's engineering team published a technical writeup explaining how it uses bloom filters, including a one-hash-function variant, to avoid unnecessary database queries. The post describes how the company checks in-memory bloom filters before querying its Scylla database for block, mute and label lookups, citing roughly 1% false-positive rates that let 99% of such checks skip the database entirely.

Python dict/set operations can degrade to O(n) time under crafted hash collisions

A technical analysis by Valentin Ignatev, discussed by a Python performance blogger, shows that Python's set and dict data structures, though usually treated as constant-time O(1) for lookups and insertions, can be forced into quadratic-time behavior. By constructing integers that share the same hash value (using a Mersenne prime modulus), it's possible to trigger repeated hash collisions that slow insertion and lookup dramatically as the collection grows.