Skip to content

Commit d02e402

Browse files
authored
removed code already present in test cases related to DFT in Trees folder (TheAlgorithms#1648)
1 parent 9c622dd commit d02e402

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

Trees/DepthFirstSearch.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,4 @@ function searchDFS(tree, value) {
4444
return null
4545
}
4646

47-
const tree = [
48-
{ value: 6, left: 1, right: 2 },
49-
{ value: 5, left: 3, right: 4 },
50-
{ value: 7, left: null, right: 5 },
51-
{ value: 3, left: 6, right: null },
52-
{ value: 4, left: null, right: null },
53-
{ value: 9, left: 7, right: 8 },
54-
{ value: 2, left: 9, right: null },
55-
{ value: 8, left: null, right: null },
56-
{ value: 10, left: null, right: null },
57-
{ value: 1, left: null, right: null }
58-
]
59-
searchDFS(tree, 9) // { value: 9, left: 7, right: 8 }
60-
searchDFS(tree, 200) // null
61-
traverseDFS(tree, 6) // [ 1, 2, 3, 4, 5, 8, 10, 9, 7, 6 ]
62-
traverseDFS(tree, 200) // []
63-
64-
// 6
65-
// / \
66-
// 5 7
67-
// / \ \
68-
// 3 4 9
69-
// / / \
70-
// 2 8 10
71-
// /
72-
// 1
7347
export { searchDFS, traverseDFS }

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy