CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
9 Trees
3
4
The trees are used in ToDoLists. They are a technical feature, and fairly
5
general, so they also can be used somewhere else.
6
7
8
9.1 Trees
9
10
9.1-1 IsTree
11
12
IsTree( arg )  filter
13
Returns: true or false
14
15
The category of trees. A tree may have a content, a list of successors, a
16
predecessor and it knows if it is a leave of a tree or not.
17
18
9.1-2 Content
19
20
Content( arg )  attribute
21
Returns: object
22
23
The content of the tree. May be any object.
24
25
9.1-3 ListOfSuccessors
26
27
ListOfSuccessors( arg )  operation
28
Returns: a list of trees
29
30
Returns the list of successors of a tree.
31
32
9.1-4 Predecessor
33
34
Predecessor( arg )  operation
35
Returns: a tree or fail
36
37
Returns the predecessor of a tree, or fail if there is none.
38
39
9.1-5 ListOfSentinels
40
41
ListOfSentinels( arg )  operation
42
Returns: a list
43
44
Returns a list of leaves of the tree.
45
46
9.1-6 RemoveHead
47
48
RemoveHead( arg )  operation
49
Returns: a tree
50
51
Returns the first successor of the tree, and adds all other successors of
52
the tree to the tree that is returned. If the tree is a leave, it returns an
53
empty tree. If the tree is empty, it returns the tree itself.
54
55
9.1-7 Tree
56
57
Tree( )  operation
58
Returns: a tree
59
60
Returns an empty tree.
61
62
9.1-8 Tree
63
64
Tree( obj )  operation
65
Returns: a tree
66
67
Returns a tree with argument obj.
68
69
9.1-9 Add
70
71
Add( tree, new_tree )  operation
72
Returns: nothing
73
74
Adds the [list of] tree[s] new_tree as successor to the tree tree.
75
76
9.1-10 ContentListFromSentinelToHead
77
78
ContentListFromSentinelToHead( sent )  operation
79
Returns: a list
80
81
Returns a list of the contents of the trees from the leave sent up to the
82
content of the head of the tree.
83
84
9.1-11 PostOrder
85
86
PostOrder( arg )  operation
87
Returns: a list
88
89
Returns the contents of the nodes of the tree in post-order.
90
91
92