Simon Willison’s Weblog

3 items tagged “datastructures”

Why does Python not have any data structures that store data in sorted order?

The bisect module provides functions for achieving this using a python list as the underlying data structure: http://docs.python.org/2/library...

[... 39 words]

What data structures are used to implement the DOM tree?

You may enjoy this post from Hixie back in 2002 which illustrates how different browsers deal with incorrectly nested HTML. IE6 used to create a tree that wasn’t actually a tree! http://ln.hixie.ch/?start=103791...

[... 49 words]

Speeding up dateutil: Python’s heapq module turns minutes into seconds. Neat case study in data structure optimisation. # 22nd December 2007, 1:07 pm