
树
李硕`丹诗尔顿
石坠可雕琢,虽美及相克。一页实则会,锁恐千秋坠。 石页不修边,一页请逃越,遂一页
20180827石坠千秋落,相克怎雕琢。一页实则许,恐至终难归。
展开
-
c# Leetcode 226 翻转二叉树 (树)
public TreeNode InvertTree(TreeNode root) { if (root==null) { return null; } TreeNode tempNode = root.left; root.left = root.right; root.right = tempNode; InvertTree(ro...原创 2018-12-17 16:32:09 · 301 阅读 · 0 评论 -
C# Leetcode 101对称二叉树 (Tree)
I notsay anything!public bool IsSymmetric(TreeNode root) { if (root==null) { return true; } return dfs(root.left, root.right); } private bool dfs(TreeNode node1, TreeNode...原创 2018-12-17 17:20:31 · 253 阅读 · 0 评论 -
c# LeetCode 100 Same Tree (树)
LeetCode 100 Same Tree判断俩个二叉树是否完全相同。此题要掌握树在c#中的写法。 //Definition for a binary tree node. public class TreeNode { public int val; public TreeNode left; public TreeNode rig...原创 2018-02-28 16:42:01 · 189 阅读 · 0 评论 -
c# Leetcode 94. 二叉树的中序遍历(树)
给定一个二叉树,返回它的中序遍历。示例:输入: [1,null,2,3] 1 \ 2 / 3输出: [1,3,2]public IList<int> InorderTraversal(TreeNode root) { List<int> listInt = new List<in...原创 2018-12-17 23:35:57 · 312 阅读 · 0 评论