YAP 7.1.0
AVL Trees

Supports constructing AVL trees. More...

Detailed Description

Supports constructing AVL trees.

@long available through the directive:

:- use_module(library(avl)).
use_module( +Files )

It includes the following predicates:

AVL trees are balanced search binary trees They are named after their inventors, Adelson-Velskii and Landis, and they were the first dynamically balanced trees to be proposed The YAP AVL tree manipulation predicates library uses code originally written by Martin van Emdem and published in the Logic Programming Newsletter, Autumn 1981 A bug in this code was fixed by Philip Vasey, in the Logic Programming Newsletter, Summer 1982 The library currently only includes routines to insert and lookup elements in the tree Please try red-black trees if you need deletion


Class Documentation

◆ avl_new/1

class avl_new/1

avl_new(+ T)

Create a new tree

◆ avl_insert/4

class avl_insert/4

avl_insert(+ Key,? Value,+ T0,- TF)

Add an element with key Key and Value to the AVL tree T0 creating a new AVL tree TF Duplicated elements are allowed

◆ avl_lookup/3

class avl_lookup/3

avl_lookup(+ Key,- Value,+ T)

Lookup an element with key Key in the AVL tree T, returning the value Value