Better HN
topnewbestaskshowjobs
Log inSign up

Hounshell

1 karma · joined Jul 8, 2014 (12y ago) · 1 submissions

Submissions

comment 12y ago · link · parent

"Self-adaptive" data structures are fairly common. Splay trees (http://en.wikipedia.org/wiki/Splay_tree) would be one of the canonical examples, where a read operation causes a node to move up in the tree, hopefully making subsequent reads of the same value faster.

"Representation" changes are fairly common as well. Typically these come about with size. There was some well known data structure (I want to say C#'s Dictionary, but a quick search disproves this) that would use an array for some small number of items (less than 10 or so), then switch to a binary tree because ultimately for a small number of items the array proved to be faster.