package searchTree

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tree_data =
  1. | Int_elt of int
  2. | Float_elt of float
  3. | String_elt of string
  4. | Char_elt of char
  5. | Couple_elt of tree_data * tree_data
  6. | None_elt

Data stored in the tree

type 'tree_data abr =
  1. | Vide
  2. | Noeud of 'tree_data abr * 'tree_data * 'tree_data abr

Data model to store the tree

val compare_data : tree_data -> tree_data -> int

Compare the data of the tree. Return an integer which symbolise the difference between two numbers.

val print_data : tree_data -> unit

Print data of a tree element.

val affichage_infixe : tree_data abr -> unit

Print the tree. The order : Left child, Node value, Right child.

val affichage_prefixe : tree_data abr -> unit

Print the tree. The order : Node value, Left child, Right child.

val affichage_suffixe : tree_data abr -> unit

Print the tree. The order : Left child, Right child, Node value.

val is_correct : tree_data abr -> bool

Verify if the tree is valid. Scan the elements of the tree to find if there are in the right order.

val size : 'a abr -> int

Return the number of node.

val mem : tree_data -> tree_data abr -> bool

Check if a tree have the searched key

Add at the right place the wanted element.

val min_elt : 'a abr -> 'b

Return the minimal element of the tree. Send an error if the tree is empty

val min_elt_opt : 'a abr -> 'b option

Return the minimal element of the tree. The optionnal version of min_elt

val max_elt : 'a abr -> 'b

Return the maximal element of the tree. Send an error if the tree is empty

val max_elt_opt : 'a abr -> 'b option

Return the maximal element of the tree. The optionnal version of max_elt

val delete : tree_data -> tree_data abr -> tree_data abr

Return the tree without the element of the selected key

OCaml

Innovation. Community. Security.