1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<!DOCTYPE HTML SYSTEM>
<!-- Generated by Lisaac shorter / html style -->
<html>
<head>
<title>
Lisaac prototype interface
</title>
</head>
<body BGCOLOR="#FFFFFF">
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Header</font></strong>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">name</font></strong> := <a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">comment</font></strong> := <font color="#BC8F8F">"Auxiliary class to implement AVL_SET."</font>;
<br><font FACE="Sans-serif" color="#000000"><B> This a classic implementation of an AVL tree (balanced tree first designed </B></font>
<br><font FACE="Sans-serif" color="#000000"><B> by Adelson-Velskii and Landis (hence A.V.L.), 1960)</B></font>
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Insert</font></strong>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">parent_avl_constants</font></strong>:<a href="AVL_CONSTANTS.html"><font color="#008000">AVL_CONSTANTS</font></a> :=
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">out_in_tagged_out_memory</font></strong> <-
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
<br><font FACE="Sans-serif" color="#000000"><B>AVL_TREE_NODE, AVL_TREE</B></font>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">left</font></strong>:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">right</font></strong>:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">item</font></strong>:<font color="#008000">E</font>;
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">balance</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
<br><em><strong><font color="#707070">        Balance factor; either `balanced' (the tree is balanced),</font></strong></em>
<br><em><strong><font color="#707070">        `imbalanced_left' (the left branch is the longer) or</font></strong></em>
<br><em><strong><font color="#707070">        `imbalanced_right' (the right branch is the longer)</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">count</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">height</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">map_in</font></strong> map:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>]] <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">has</font></strong> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' in the tree?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_has</font></strong> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' in the tree?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">at</font></strong> e:<font color="#008000">E</font> :<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>] <-
<br><em><strong><font color="#707070">        Is element `e' in the tree?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">set_item</font></strong> i:<font color="#008000">E</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">set_left</font></strong> l:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>] <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">set_right</font></strong> r:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>] <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">set_balance</font></strong> b:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><br><strong><font color="#A020F0">Section</font></strong> <a href="AVL_TREE.html"><font color="#008000">AVL_TREE</font></a>, <a href="AVL_DICTIONARY.html"><font color="#008000">AVL_DICTIONARY</font></a>, <a href="AVL_SET.html"><font color="#008000">AVL_SET</font></a>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Rotations:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">rotate_right</font></strong>:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>] <-
<br><em><strong><font color="#707070">        Proceeds to some reorganisation and returns the upper node.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">rotate_left</font></strong>:<a href="AVL_TREE_NODE.html"><font color="#008000">AVL_TREE_NODE</font></a>[<font color="#008000">E</font>] <-
<br><em><strong><font color="#707070">        Proceeds to some reorganisation and returns the upper node.</font></strong></em>
</body>
</html>
|