package prbnmcn-stats

  1. Overview
  2. Docs

Module Make.TreeSource

Tree defines a type of trees and functions to construct, deconstruct and iterate on those trees.

Sourcetype t
Sourceval cons : vertex -> t list -> t

cons v sub constructs a tree with root v and subtrees sub.

Sourceval uncons : t -> vertex * t list

uncons t deconstructs t into a pair of its root and its subtrees.

Sourceval mem_vertex : t -> vertex -> bool

mem_vertex t v

Sourceval iter_vertices : t -> (vertex -> unit) -> unit

iter_vertices t f iterates f on the nodes of t.

Sourceval iter_edges : t -> ((vertex * vertex) -> unit) -> unit

iter_edges t f iterates f on the edges of t. The edges are directed from each node towards its subtrees.

OCaml

Innovation. Community. Security.