update 0051.N皇后:添加复杂度分析

This commit is contained in:
Yuhao Ju
2023-04-27 16:44:28 +08:00
committed by GitHub
parent 1a9cb629ae
commit 2a7f4d5d4b

View File

@ -208,6 +208,9 @@ public:
}
};
```
* 时间复杂度: O(n!)
* 空间复杂度: O(n)
可以看出,除了验证棋盘合法性的代码,省下来部分就是按照回溯法模板来的。