deno.land / x / masx200_leetcode_test@10.6.5 / check-completeness-of-a-binary-tree / test.ts

نووسراو ببینە
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
import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";
import { TreeNodeLeetCodeParse as deserialize } from "../utils/TreeNodeLeetCodeParse.ts";import isCompleteTree from "./index.ts";
Deno.test("check-completeness-of-a-binary-tree", () => { const inputs = [ "[1,2,3,4,5,6,7]", "[1,2,3,4,5,6]", "[1,2,3,4,5,null,7]", "[1,2,3,5,null,7,8]", "[1,2,3,4,5,6,7,8,9,10,11,12,13,null,null,15]", "[1,2,3,4,5,6]", "[1,2,3,4,5,6,7,8,9,10,11,12,13,null,null,15]", ]; const outputs = [true, true, false, false, false, true, false]; assertEquals( inputs.map((input) => { const root = deserialize(input); return isCompleteTree(root); }), outputs, );});
masx200_leetcode_test

Version Info

Tagged at
a year ago