In the tree-search algorithm, the goal test is applied after a node is removed from the queue. We saw that breadth-first search (BFS) and uniform cost search (UCS) are optimal tree-search strategies. Consider a variant of tree-search in which the goal test occurs when nodes are expanded instead, right before they are inserted into the queue.
a) Is BFS (with uniform step costs) still optimal in this variant? Why or why not? [2 points]
b) Is UCS (with non-uniform step costs) still optimal in this variant? Why or why not? [2 points]