-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trees.cpp
67 lines (45 loc) · 1.31 KB
/
Trees.cpp
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
//
// Created by ehsan on 4/5/17.
//
#include <stddef.h>
#include "Trees.h"
Elem &LinkedBinaryTree::Position::operator*() {
return _v->elt;
}
LinkedBinaryTree::Position LinkedBinaryTree::Position::left() const {
return _v->left;
}
LinkedBinaryTree::Position LinkedBinaryTree::Position::right() const {
return _v->right;
}
bool LinkedBinaryTree::Position::isRoot() const {
return _v->parent==NULL;
}
LinkedBinaryTree::Position LinkedBinaryTree::Position::parent() const {
return _v->parent;
}
bool LinkedBinaryTree::Position::isExternal() const {
return _v->left==NULL && _v->right==NULL;
}
LinkedBinaryTree::LinkedBinaryTree() {
}
bool LinkedBinaryTree::empty() const {
return false;
}
int LinkedBinaryTree::size() const {
return 0;
}
LinkedBinaryTree::Position LinkedBinaryTree::root() const {
return LinkedBinaryTree::Position(nullptr);
}
void LinkedBinaryTree::addRoot() {
}
void LinkedBinaryTree::expandExternal(const LinkedBinaryTree::Position &p) {
}
LinkedBinaryTree::Position LinkedBinaryTree::removeAboveExternal(const LinkedBinaryTree::Position &p) {
return LinkedBinaryTree::Position(nullptr);
}
void LinkedBinaryTree::preorder(LinkedBinaryTree::Node *v, list <Position> &pl) const {
}
list<LinkedBinaryTree::Position> LinkedBinaryTree::getAllPositions() const {
}