LeetCode - Tree 总结

本文详细介绍了二叉树的多种遍历方法,包括前序、中序、后序和层级遍历,并探讨了如何从不同的遍历序列构建二叉树。此外,还涵盖了平衡二叉树、二叉搜索树的验证、最近公共祖先、序列化与反序列化等高级主题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Preorder, Inorder, Postorder and Level order Traversal

Construct Binary Tree from Preorder and Inorder Traversal

Construct Binary Tree from Inorder and Postorder Traversal

Construct Binary Tree from Preorder and Postorder Traversal [exist multiple solutions]

Binary Tree Preorder Traversal

Binary Tree Inorder Traversal

Inorder Successor in BST

Closest Binary Search Tree Value II [inorder]

Kth Smallest Element in a BST [inorder]

Binary Tree Level Order Traversal

Binary Tree Zigzag Level Order Traversal

Binary Tree Vertical Order Traversal

Binary Search Tree

Validate Binary Search Tree

Unique Binary Search Trees, II (construct the actual trees)

Recover Binary Search Tree

Convert Sorted List to Binary Search Tree

Lowest Common Ancestor

Lowest Common Ancestor of a Binary Search Tree

Lowest Common Ancestor of a Binary Tree

Design

Serialize and Deserialize Binary Tree

Serialize and Deserialize BST [hehe, same as the above one]

Serialize and Deserialize N-ary Tree

Binary Search Tree Iterator

Find Median from Data Steam

Design Search Autocomplete System

LRU Cache

LFU Cache

Sum of Distance in Tree

All O'one Data Structure

Insert Delete GetRandom O(1) - Duplicates allowed

String

Construct String from Binary Tree

Contruct Binary Tree from String

Linked List

Flatten Binary Tree to Linked List

Convert Binary Search Tree to Sorted Doubly Linked List

Other

Symmetric Tree

Binary Tree Right Side View

Balanced Binary Tree [depth of the tree]

Binary Tree Maximum Path Sum

Populating Next Right Pointers in Each Node, II

Merge Two Binary Trees

Count Univalue Subtrees

Kill Process

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值