const binarySearchTree = (node = tree, target = 8) => { let curNode = node while(true){ if(!curNode){ return false } if(curNode.value > target){ curNode = curNode.left }else if(curNode.value < target){ curNode = curNode.right }else { return true } } }
标签:node,value,target,是否,某值,二叉树,curNode From: https://www.cnblogs.com/zhenjianyu/p/17068442.html