Mryan2005's Blog
All Things is in it
主页
作品
Problem: 94. 二叉树的中序遍历
我们都知道中序遍历是左边 ——> 中间 ——> 右边
时间复杂度:
O(n)O(n)O(n)
空间复杂度:
Problem: 20. 有效的括号
Mryan2005,觉得要先将不相干的先入栈,然后,当遇到相关的括号时,出栈。
有思路可得
Problem: 9. 回文数
先拆分,后对比
有思路可知。
O(log2n)O(log_2n)O(log2n)