mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-23 12:54:04 +00:00
[binary-tree] bfs simplified
This commit is contained in:
parent
8df45c5c52
commit
23cbdbabca
|
@ -102,8 +102,7 @@ describe('AVL Tree Test', () => {
|
|||
expect(lastBFSIds[1]).toBe(2);
|
||||
expect(lastBFSIds[2]).toBe(16);
|
||||
|
||||
const lastBFSNodes: AVLTreeNode<number>[] = [];
|
||||
tree.bfs(node => lastBFSNodes.push(node));
|
||||
const lastBFSNodes = tree.bfs(node => node);
|
||||
expect(lastBFSNodes[0].key).toBe(12);
|
||||
expect(lastBFSNodes[1].key).toBe(2);
|
||||
expect(lastBFSNodes[2].key).toBe(16);
|
||||
|
|
Loading…
Reference in a new issue