B. Bear and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The bear has a string s = s1s2... s|s| (record |s|
题目内容 https://leetcode-cn.com/problems/invert-binary-tree/ Invert a binary tree. 题目思路 基本操作,使用递归。先设置递归条件,然后交换左右两个节点。接下来分别翻转左子树和右子树。最后返回根节点。 程序代码 # Definition for a binary tree node.# class Tr
102.二叉树的层序遍历(opens new window) 107.二叉树的层次遍历II(opens new window) 199.二叉树的右视图(opens new window) 637.二叉树的层平均值(opens new window) 429.N叉树的层序遍历(opens new window) 515.在每个树行中找最大值(opens new window) 116.填充每个节点