deno.land / x / masx200_leetcode_test@10.6.5 / er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof / test.ts
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224import { assertEquals } from "asserts";
import { TreeNodeLeetCodeFromJSON } from "../utils/TreeNodeLeetCodeParse.ts";import { ArrayToCircularDoublyTreeList } from "./ArrayToCircularDoublyTreeList.ts";import treeToDoublyList from "./index.ts";
Deno.test("er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof", () => { const inputs = [ [ 619, 933, 977, 408, 879, 741, 172, 889, 295, 167, 396, 490, 803, 754, 326, 724, 423, 872, 373, 746, 579, 601, 781, 864, 139, 195, 84, 48, 811, 529, 352, 355, 980, 789, 425, 354, 749, 890, 633, 677, 282, 54, 879, 239, 34, 55, 220, 653, 752, 397, 988, 827, 57, 573, 516, 614, 524, 686, 179, 183, 995, 0, 797, 875, 961, 620, 750, 241, 669, 303, 719, 989, 73, 509, 228, 342, 655, 144, 639, 294, 599, 306, 115, 742, 106, 590, 433, 235, 673, 843, 315, 828, 661, 863, 994, 67, 154, 177, 169, 521, ], [4, 2, 5, 1, 3], ]; const outputs = [ [ 875, 355, 961, 724, 620, 980, 750, 889, 241, 789, 669, 423, 303, 425, 719, 408, 989, 354, 73, 872, 509, 749, 228, 295, 342, 890, 655, 373, 144, 633, 639, 933, 294, 677, 599, 746, 306, 282, 115, 167, 742, 54, 106, 579, 590, 879, 433, 879, 235, 239, 673, 601, 843, 34, 315, 396, 828, 55, 661, 781, 863, 220, 994, 619, 67, 653, 154, 864, 177, 752, 169, 490, 521, 397, 139, 988, 741, 827, 195, 57, 803, 573, 84, 516, 977, 614, 48, 524, 754, 686, 811, 179, 172, 183, 529, 995, 326, 0, 352, 797, ], [1, 2, 3, 4, 5], ];
assertEquals( outputs.map(ArrayToCircularDoublyTreeList), inputs.map(TreeNodeLeetCodeFromJSON).map(treeToDoublyList), );});
Version Info