摘要: ``` /** * 102. Binary Tree Level Order Traversal * 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> levelOrder(TreeNode root) { List> res = 阅读全文
posted @ 2020-04-27 12:07 AAAmsl 阅读(65) 评论(0) 推荐(0) 编辑
摘要: ```/** * 145. Binary Tree Postorder Traversal * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) * 3. Time:O(n) Space:O(n) * 4. Time:O(n) Space:O(1) */// 1. Time:O(n) Space:O(n)class Solution { ... 阅读全文
posted @ 2020-04-27 12:05 AAAmsl 阅读(62) 评论(0) 推荐(0) 编辑
摘要: ```/** * 94. Binary Tree Inorder Traversal * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) * 3. Time:O(n) Space:O(1) */// 1. Time:O(n) Space:O(n)class Solution { public List inorderTraversa... 阅读全文
posted @ 2020-04-27 12:04 AAAmsl 阅读(75) 评论(0) 推荐(0) 编辑
摘要: ```/** * 144. Binary Tree Preorder Traversal * 1. Time:O(n) Space:O(n) * 2. Time:O(n) Space:O(n) * 3. Time:O(n) Space:O(n) * 4. Time:O(n) Space:O(1) */// 1. Time:O(n) Space:O(n)class Solution { ... 阅读全文
posted @ 2020-04-27 12:03 AAAmsl 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 代码 解释 public 访问修饰符,控制程序的其他部分对这段代码的访问级别 class 关键字,表示类 FirstSample 类名 Java中类名的命名规定 以字母开头,后面可以跟字母和数字的任意组合,长度基本上没有限制 类名不能是Java保留字 main方法 Java 1.4之后强制main方 阅读全文
posted @ 2020-04-27 11:59 AAAmsl 阅读(124) 评论(0) 推荐(0) 编辑