跳到主要内容

面试题 · 树

Kth Smallest Element in a BST

Kth Smallest Element in a BST 是一道难度为中等的题目,使用 trees 模式。PrepKit 将其归入 树。

PrepKit 只列出标题和链接,题目描述保留在原站。

正在检查你的收藏

版权与更正请求

来源内容语言:英语

要点

主题
树
解题模式
trees
难度
中等
收录于
Grind 75
网站
leetcode.com
许可
MIT License

使用方法

  1. 在原站阅读题目。
  2. 先自己尝试,再看提示或题解。
  3. 然后做一道使用相同模式的相关题目。

关于 树 模式

PrepKit 学习笔记。这些内容由 PrepKit 编辑撰写,属于通用建议,并非取自题目本身或任何已发布的题解。

是什么
处理带子节点的节点,最常见的是二叉树和二叉搜索树,通常用深度优先或广度优先遍历来解。
如何识别
输入是根节点,或者答案取决于深度、路径、祖先、子树或节点的排序顺序。
常见陷阱
忘记处理空子节点的终止条件,混淆递归调用返回的值和它更新的状态,以及以为任何二叉树都是平衡的搜索树。

相关备考资料

这些是 PrepKit 的学习建议,不代表雇主推荐,也不预测面试题目。

收录此条目的页面

常见问题

在哪里练习 Kth Smallest Element in a BST?

在 leetcode.com 打开它。PrepKit 只提供链接,不复制题目。

Kth Smallest Element in a BST 使用什么模式?

PrepKit 将其归入 trees,难度为中等。

来源与许可

来源和许可

作者:
Yangshun Tay
来源版本:
e1d28e8
上次与来源核对:
修改:
PrepKit kept only Grind 75 question titles, difficulty, topic, and LeetCode links. The weekly schedule, durations, and ordering are not copied, and no LeetCode problem text is stored.
访问原始来源
完整的许可和版权声明

MIT License Copyright (c) 2017-Present Yangshun Tay Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.