package searchTree

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module SearchTreeSource

Sourcetype 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

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

Data model to store the tree

Sourceval compare_data : tree_data -> tree_data -> int

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

Sourceval print_data : tree_data -> unit

Print data of a tree element.

Sourceval affichage_infixe : tree_data abr -> unit

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

Sourceval affichage_prefixe : tree_data abr -> unit

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

Sourceval affichage_suffixe : tree_data abr -> unit

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

Sourceval 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.

Sourceval size : 'a abr -> int

Return the number of node.

Sourceval mem : tree_data -> tree_data abr -> bool

Check if a tree have the searched key

Add at the right place the wanted element.

Sourceval min_elt : 'a abr -> 'a

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

Sourceval min_elt_opt : 'a abr -> 'a option

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

Sourceval max_elt : 'a abr -> 'a

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

Sourceval max_elt_opt : 'a abr -> 'a option

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

Return the tree without the element of the selected key

OCaml

Innovation. Community. Security.