Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.43的答案有问题 #47

Open
Deginch opened this issue Oct 22, 2016 · 0 comments
Open

2.43的答案有问题 #47

Deginch opened this issue Oct 22, 2016 · 0 comments

Comments

@Deginch
Copy link

Deginch commented Oct 22, 2016

2.42的函数每计算一次queen-col k需要既然一次queen-col (k-1),计算一次queen (k-2),计算一次queen (k-3)...最终只需计算一次queen-col 1。
而Louis的函数每计算一次queen-col l需计算board-size次queen-col (k-1), 计算queen-col (k-1) 需要计算board-size次 queen-col (k-2).故计算queen-col board-size需要计算board-size的board-size次方次queen-col 1。
故Louis的函数需要pow(board-size,board-size)*T的时间。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant