diff --git a/collects/data/scribblings/splay-tree.scrbl b/collects/data/scribblings/splay-tree.scrbl new file mode 100644 index 0000000000..baecb0d5bd --- /dev/null +++ b/collects/data/scribblings/splay-tree.scrbl @@ -0,0 +1,159 @@ +#lang scribble/manual +@(require scribble/eval + (for-label data/splay-tree + racket/contract + racket/dict + racket/base)) + +@title{Splay Trees} + +@(define the-eval (make-base-eval)) +@(the-eval '(require data/splay-tree)) +@(the-eval '(require racket/dict)) + +@defmodule[data/splay-tree] + +@author[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]] + +Splay trees are an efficient data structure for mutable dictionaries +with totally ordered keys. They were described in the paper +``Self-Adjusting Binary Search Trees'' by Daniel Sleator and Robert +Tarjan in Journal of the ACM 32(3) pp652-686. + +A splay-tree is a dictionary (@racket[dict?] from +@racketmodname[racket/dict]). It also supports extensions of the +dictionary interface for iterator-based search. + +@defproc[(make-splay-tree [=? (-> any/c any/c any/c)] + [ any/c any/c any/c)] + [#:key-contract key-contract contract? any/c] + [#:value-contract value-contract contract? any/c]) + splay-tree?]{ + +Makes a new empty splay-tree. The splay tree uses @racket[=?] and +@racket[list [s splay-tree?]) (listof pair?)]{ + +Returns an association list with the keys and values of @racket[s], in +order. +}