Operations: Collections
N/A = not applicable
|
create |
create: Ø ==> C C = set, sequence, tree, graph |
remove |
remove: C ==> Ø C = set, sequence, tree, graph |
display |
display: C ==> C C = set, sequence, tree, graph |
Collection: |
Set |
Sequence |
Stack |
Queue |
add value |
add: Set * v ==> Set |
add: Seq * v ==> Seq |
push: Stack * v ==> Stack |
enqueue: Queue * v ==> Queue |
sequence add value by position |
N/A |
add: Seq * v * p ==> Seq |
add: Seq * v * 1 ==> Seq |
add: Seq * v * n+1 ==> Seq |
remove value |
remove: Set * v ==> Set |
remove: Seq * v ==> Seq |
pop: Stack ==> Stack |
dequeue: Queue ==> Queue |
sequence remove value by position |
N/A |
remove: Seq * p ==> Seq |
remove: Seq * v * 1 ==> Seq |
remove: Seq * v * 1 ==> Seq |
find value |
find: Set * v ==> Boolean (member) |
find: Seq * v ==> ref or Boolean or position |
N/A |
N/A |
sequence find value by position |
N/A |
find: S * p ==> v |
N/A |
N/A |
navigate |
N/A |
first: S ==> ref next: S ==> ref prev: S ==> ref last: S ==> ref |
N/A |
Properties |
Collection: |
Set |
Sequence |
Stack |
Queue |
Ordered |
no |
yes |
LIFO |
FIFO |
Sorted |
no |
possibly |
no |
no |
Unique Values |
yes |
no |
no |
no |
Graph Relationship |
Set of Nodes |
Singly linked list: directed Doubly linked list: undirected |
N/A |
Max In / Out Edges |
0 / 0 |
1 / 1 |
N/A |
Operations: Collections |
create |
create: Ø ==> C C = T, BT, BST, AVL, B-Tree |
remove |
remove: C ==> Ø C = T, BT, BST, AVL, B-Tree |
display |
display: C ==> C C = T, BT, BST, AVL, B-Tree |
Collection: |
Tree |
Binary Tree |
BST |
AVL |
B-Tree |
add value |
add: C * v ==> C
C = T(?), BT(?), BST, AVL, B-Tree |
remove value |
remove: C * v ==> C C = T(?), BT(?), BST, AVL, B-Tree |
find value |
find: C * v ==> ref
C = T, BT, BST, AVL, B-Tree |
navigate + display v: |
preorder, inorder (n), postorder general, breadth-first
Tree ==> Seq
|
Properties |
Collection: |
Tree |
Binary Tree |
BST |
AVL |
B-Tree |
Ordered |
yes / no |
yes / no |
yes |
yes |
yes |
Sorted |
possibly |
possibly |
yes |
yes |
yes |
Balanced |
no |
no |
no |
| h(L) - h(R) | <= 1 |
completely |
Graph Relationship |
Directed Acyclic Graph |
Max In / Out Edges |
1 / n |
1 / 2 |
1 / 2 |
1 / 2 |
1 / n |
|
|
|