NonStatic

Results comments of NonStatic

现在的PDF里面三个解法都说自己是空间复杂度O(logn)。我的代码如下: ``` c++ class Solution { public: void flatten(TreeNode *root) { TreeNode *p = root; while (p != NULL) { if (p->left != NULL) { TreeNode *q = p->left; while...

有趣的是我优化了一下,变成了下面这样。提交后运行时间从上面那个代码的60ms变成了24ms。算法没有变化,只是少了一些if-else,居然快了一倍 ``` c++ class Solution { public: void flatten(TreeNode *root) { while (root != NULL) { if (root->left != NULL) { TreeNode *q = root->left; while (q->right != NULL) {...

我知道的算法属于O(nlogn)的,但这属于用时间换空间,因为题目明确要求in-place。好像不可能做到O(n)时间O(1)空间吧。

嗯,我这里的意思是既然题目要求了in-place,这种空间O(1)的解法也应该被列到书里,你觉得呢?

My workaround: 1. Create a file: `/etc/wsl.conf`. 2. Put the following lines in the file ``` [network] generateResolvConf = false ``` 3. In a `cmd` window, run `wsl --shutdown` 4....

You could try to check the "code" in the theme file. What I have is something like this: ``` prompt_go() { setopt extended_glob if [[ (-f *.go(#qN) || -d Godeps...