style: Fixed most styles (according to standardjs)

This commit is contained in:
Rak Laptudirm
2021-05-21 11:16:11 +05:30
parent 37ef611136
commit ca4c1a62af
22 changed files with 176 additions and 176 deletions

View File

@ -25,13 +25,13 @@ function traverseDFS (root) {
}
function searchDFS (tree, value) {
var stack = []
const stack = []
stack.push(tree[0])
while (stack.length !== 0) {
for (let i = 0; i < stack.length; i++) {
var node = stack.pop()
const node = stack.pop()
if (node.value === value) {
return node
@ -47,7 +47,7 @@ function searchDFS (tree, value) {
return null
}
var tree = [
const tree = [
{ value: 6, left: 1, right: 2 },
{ value: 5, left: 3, right: 4 },
{ value: 7, left: null, right: 5 },