摘要:
DFS 深度优先BFS 广度优先DFS或者BFS都是在联通区域内遍历节点的方法用在二叉树上DFS有preOreder,inOrder,postOrder,BFS就是层次遍历。在二叉树上的节点,只有两个选择,left 和right,即,对于每一个节点,in 有1个, out 有两个,有向图在矩阵的节点... 阅读全文
摘要:
Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文