MCPcopy Create free account
hub / github.com/nodejs/node / createSampleTree

Function createSampleTree

deps/v8/test/mjsunit/tools/splaytree.mjs:49–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48
49function createSampleTree() {
50 // Creates the following tree:
51 // 50
52 // / \
53 // 30 60
54 // / \ \
55 // 10 40 90
56 // \ / \
57 // 20 70 100
58 // / \
59 // 15 80
60 //
61 // We can't use the 'insert' method because it also uses 'splay_'.
62 return { key: 50, value: 50,
63 left: { key: 30, value: 30,
64 left: { key: 10, value: 10, left: null,
65 right: { key: 20, value: 20,
66 left: { key: 15, value: 15,
67 left: null, right: null },
68 right: null } },
69 right: { key: 40, value: 40, left: null, right: null } },
70 right: { key: 60, value: 60, left: null,
71 right: { key: 90, value: 90,
72 left: { key: 70, value: 70, left: null,
73 right: { key: 80, value: 80,
74 left: null, right: null } },
75 right: { key: 100, value: 100,
76 left: null, right: null } } } };
77};
78
79
80(function testSplay() {

Callers 1

splaytree.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected