(self, target)
return None
search the entire tree looking for a value" in bfs order
search the entire tree looking for a value" in bfs order
search the entire tree looking for a value in bfs order
def search_bfs(self, target):
        """ search the entire tree looking for a value" in bfs order"""
        queue = deque([self.root])
        while queue:
            curr = queue.popleft()
            if curr.val == target:
                return curr
            if curr.left is not None:
                queue.append(curr.left)
            if curr.right is not None:
                queue.append(curr.right)
        return None
def search_bfs ( self , target ) : queue = deque ( [ self . root ] ) while queue : curr = queue . popleft ( ) if curr . val == target : return curr if curr . left is not None : queue . append ( curr . left ) if curr . right is not None : queue . append ( curr . right ) return None