Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored Oct 4, 2018
1 parent f03f7fd commit 7703b79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BFS/913.Cat-and-Mouse/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

此题是game thoery中的好题.看上去像常规的minMax问题,但实际上几乎所有的DFS解法都是不完备的,参看leetcode的讨论区.

争取的解法是用BFS.我们设计节点状态是(m,c,turn),用color[m][c][turn]来记忆该状态的输赢情况.
正确的解法是用BFS.我们设计节点状态是(m,c,turn),用color[m][c][turn]来记忆该状态的输赢情况.

首先我们将所有已知的状态加入一个队列.已知状态包括(0,c,turn)肯定是老鼠赢,(x,x,turn)且x!=0肯定是猫赢.我们尝试用BFS的思路,将这些已知状态向外扩展开去.

Expand Down

0 comments on commit 7703b79

Please sign in to comment.