-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmptyBST.js
30 lines (30 loc) · 819 Bytes
/
EmptyBST.js
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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NonEmptyBST_1 = require("./NonEmptyBST");
/**
* A class that reappresent an empty Binary Tree
*/
var EmptyBST = /** @class */ (function () {
function EmptyBST() {
}
EmptyBST.prototype.isEmpty = function () {
return true;
};
EmptyBST.prototype.cardinality = function () {
return 0;
};
EmptyBST.prototype.search = function (elem) {
return false;
};
EmptyBST.prototype.insert = function (elem) {
return new NonEmptyBST_1.default(elem);
};
EmptyBST.prototype.inOrderTraverse = function (callback) {
return;
};
EmptyBST.prototype.preOrderTraverse = function (callback) {
return;
};
return EmptyBST;
}());
exports.default = EmptyBST;