随笔分类 - LeetCode刷题
摘要:116. 填充每个节点的下一个右侧节点指针 给定一个 完美二叉树 ,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下: struct Node { int val; Node *left; Node *right; Node *next; } 填充它的每个 next 指针,让这个指
阅读全文
摘要:226. Invert Binary Tree Given the root of a binary tree, invert the tree, and return its root. Example 1 Input: root = [4,2,7,1,3,6,9] Output: [4,7,2,
阅读全文

浙公网安备 33010602011771号