![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
剑指offer
SpuerWei
王筱维童鞋努力coding!
展开
-
剑指offer19,二叉树的镜像 -- LeetCode #226
public class test19{ public TreeNode invertTree(TreeNode root) { if(root == null) return root; if(root.left == null && root.right == null) return root; TreeNode temp = root.le...原创 2019-04-19 00:46:59 · 258 阅读 · 0 评论 -
剑指offer20,顺时针打印矩阵 -- LeetCode #54 spiralOrder
public class test20{ public List<Integer> spiralOrder(int[][] matrix) { List answer = new ArrayList(); if(matrix.length == 0) return answer; int rows = m...原创 2019-04-19 00:49:28 · 150 阅读 · 0 评论 -
剑指offer25 -- LeetCode #112 Path Sum
public class test25 { public boolean hasPathSum(TreeNode root, int sum) { if(root == null) return false; if(root.left == null && root.right == null && ...原创 2019-04-19 00:51:15 · 126 阅读 · 0 评论