Movatterモバイル変換


[0]ホーム

URL:


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

Commit7cf642a

Browse files
committed
added trace to construct elements
still work pending in construct and tree code
1 parent47010c4 commit7cf642a

File tree

3 files changed

+452
-26
lines changed

3 files changed

+452
-26
lines changed

‎algorithm/tree/binary_search_tree/bst_insert/data.js‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
varG=[// G[i][j] indicates whether the path from the i-th node to the j-th node exists or not
2-
[0,0,0,0,0,0,0,0,0,0,0],
3-
[0,0,0,0,0,0,0,0,0,0,0],
4-
[0,0,0,0,0,0,0,0,0,0,0],
5-
[0,0,0,0,0,0,0,0,0,0,0],
6-
[0,0,0,0,0,0,0,0,0,0,0],
7-
[0,0,0,0,0,0,0,0,0,0,0],
8-
[0,0,0,0,0,0,0,0,0,0,0],
9-
[0,0,0,0,0,0,0,0,0,0,0],
10-
[0,0,0,0,0,0,0,0,0,0,0],
11-
[0,0,0,0,0,0,0,0,0,0,0],
12-
[0,0,0,0,0,0,0,0,0,0,0]
13-
];
1+
varG=[];
142

153

16-
varT=[// mapping to G as a binary tree , [i][0] indicates left child, [i][1] indicates right child
17-
[-1,-1],
18-
[-1,-1],
19-
[-1,-1],
20-
[-1,-1],
21-
[-1,-1],
22-
[-1,-1],
23-
[-1,-1],
24-
[-1,-1],
25-
[-1,-1],
26-
[-1,-1],
27-
[-1,-1]
28-
];
4+
varT={};
295

306
varelements=[5,8,10,3,1,6,9,7,2,0,4];// item to be searched
317
vartracer=newDirectedGraphTracer(" BST - Elements marked red indicates the current status of tree ");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp