代码重构 【Github Actions】

This commit is contained in:
github-actions[bot]
2021-07-29 02:33:38 +00:00
parent 5a5325b0c8
commit a8b66cd5ae
38 changed files with 110 additions and 159 deletions

View File

@@ -49,10 +49,10 @@ class Solution {
public List<Integer> preorderTraversal(TreeNode root) {
List<Integer> list = new ArrayList<>();
Stack<TreeNode> stack = new Stack<>();
if (root == null) return list;
if (root == null) return list;
stack.push(root);
while (!stack.isEmpty()) {
TreeNode temp = stack.pop();
TreeNode temp = stack.pop();
if (temp.right != null) {
stack.push(temp.right);
}