Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 29b1650

Browse files
christian-feiTheSTL
authored andcommitted
add test for bottom view binary tree (#147)
* add test for bottom view binary tree
1 parent 9793691 commit 29b1650

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const BinaryTree = require("../index");
2+
const bottomView = require('.');
3+
4+
describe('Bottom View Binary Tree', () => {
5+
let btree
6+
7+
beforeEach(() => {
8+
btree = new BinaryTree([1, 2, 3, 4, 5, 6]);
9+
});
10+
11+
it('Should determine the bottom view of a binary tree', () => {
12+
expect(bottomView(btree)).toEqual([6, 2, 3, 4]);
13+
});
14+
it('Should handle null binary tree', () => {
15+
expect(bottomView(null)).toEqual([]);
16+
});
17+
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /