Yang406
Yang406
全部文章
分类
题解(7)
归档
标签
去牛客网
登录
/
注册
Yang406的博客
全部文章
(共7篇)
题解 | #二叉树的之字形层序遍历# #Go#
Go实现如下 func zigzagLevelOrder( root *TreeNode ) [][]int { // write code here if root == nil { return make([][]int, 0, 0) } var ...
2021-07-01
0
415
题解 | #求二叉树的层序遍历# #Go#
Go实现如下,有大神可以指导一下有什么方便的队列使用吗 func levelOrder( root *TreeNode ) [][]int { // write code here if root == nil { return make([][]int, 0, 0...
2021-06-30
0
405
题解 | #判断二叉树是否对称# #Go#
Go实现如下 func isSymmetric( root *TreeNode ) bool { // write code here if root == nil { return true } return doCheckSymmetric(roo...
2021-06-30
0
349
题解 | #二叉树的最大深度# #Go#
Go实现如下: package main import . "nc_tools" /* * type TreeNode struct { * Val int * Left *TreeNode * Right *TreeNode * } */ /** ...
2021-06-29
0
309
题解 | #重建二叉树# #Go#
Go的递归实现 package main import . "nc_tools" /* * type TreeNode struct { * Val int * Left *TreeNode * Right *TreeNode * } */ /** *...
2021-06-29
0
379
题解 | #二叉树中是否存在节点和为指定值的路径# #Go#
解题思路大同小异,但是分享一下Go的实现 package main import . "nc_tools" /* * type TreeNode struct { * Val int * Left *TreeNode * Right *TreeNode * ...
2021-06-29
0
388
题解 | #二叉树根节点到叶子节点和为指定值的路径# #Go#
思路就不说啦,以后有时间补,只是作为一个go的初学者,在这里找不到go的实现,所以尝试留点东西 package main import . "nc_tools" /* * type TreeNode struct { * Val int * Left *TreeNo...
2021-06-28
0
503