package batteries

  1. Overview
  2. Docs
A community-maintained standard library extension

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v3.7.2.tar.gz
md5=1fd7bddce07cf5d244fc9427f7b5e4d4
sha512=c0f2a0fdc8253e0ea999d8d4c58bfbf32b18d251a2e1d9656bf279de5f01a33e9aabac3af4d95f465f8b671e7711ebd37218043face233340a0c11b08fa62f78

doc/batteries.unthreaded/BatAvlTree/index.html

Module BatAvlTreeSource

Internals of ISet and IMap, usable as generic tree library

Sourcetype +'a tree
Sourceval empty : 'a tree
Sourceval is_empty : 'a tree -> bool
Sourceval make_tree : 'a tree -> 'a -> 'a tree -> 'a tree
Sourceval create : 'a tree -> 'a -> 'a tree -> 'a tree

create l v r is similar to make_tree l v r but performs no rebalancing; in other words, you should use this only when you know that l and r are already balanced.

Sourceval height : 'a tree -> int
Sourceval left_branch : 'a tree -> 'a tree
Sourceval right_branch : 'a tree -> 'a tree
Sourceval root : 'a tree -> 'a
Sourceval singleton_tree : 'a -> 'a tree
Sourceval split_leftmost : 'a tree -> 'a * 'a tree
Sourceval split_rightmost : 'a tree -> 'a * 'a tree
Sourceval concat : 'a tree -> 'a tree -> 'a tree
Sourceval iter : ('a -> unit) -> 'a tree -> unit
Sourceval fold : ('a -> 'b -> 'b) -> 'a tree -> 'b -> 'b
Sourceval enum : 'a tree -> 'a BatEnum.t
Sourceval check : 'a tree -> bool

Check that the tree is balanced according to the AVL tree rules. An AVL tree is balanced when for every node the height of the subnodes differs by at most 1.

  • since 2.3.0
OCaml

Innovation. Community. Security.