摘要:
```/** * 173. Binary Search Tree Iterator * 1. Time:O() Space:O() * 2. Time:O() Space:O() */// 1. Time:O() Space:O()class BSTIterator { ArrayList res; int index; public BSTIterator(Tre... 阅读全文
摘要:
```/** * 226. Invert Binary Tree * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) */// 1. Time:O(n) Space:O(n)class Solution { public TreeNode invertTree(TreeNode root) { if(root==null... 阅读全文
摘要:
``` /** * 199. Binary Tree Right Side View * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) */ // 1. Time:O(n) Space:O(n) class Solution { public List rightSideView(TreeNode root) { List res = new 阅读全文
摘要:
```/** * 107. Binary Tree Level Order Traversal II * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) */// 1. Time:O(n) Space:O(n)class Solution { public List> levelOrderBottom(TreeNode root) {... 阅读全文