1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给定一个二叉搜索树的根节点 <code>root</code> ,和一个整数 <code>k</code> ,请你设计一个算法查找其中第 <code>k</code><strong> </strong>个最小元素(从 1 开始计数)。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/01/28/kthtree1.jpg\" style=\"width: 212px; height: 301px;\" />\n<pre>\n<strong>输入:</strong>root = [3,1,4,null,2], k = 1\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 2</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/01/28/kthtree2.jpg\" style=\"width: 382px; height: 302px;\" />\n<pre>\n<strong>输入:</strong>root = [5,3,6,2,4,null,null,1], k = 3\n<strong>输出:</strong>3\n</pre>\n\n<p> </p>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树中的节点数为 <code>n</code> 。</li>\n\t<li><code>1 <= k <= n <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= Node.val <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>如果二叉搜索树经常被修改(插入/删除操作)并且你需要频繁地查找第 <code>k</code> 小的值,你将如何优化算法?</p>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 595,
"likes": 606,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Binary Tree Inorder Traversal\", \"titleSlug\": \"binary-tree-inorder-traversal\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u4e8c\\u53c9\\u6811\\u7684\\u4e2d\\u5e8f\\u904d\\u5386\"}, {\"title\": \"Second Minimum Node In a Binary Tree\", \"titleSlug\": \"second-minimum-node-in-a-binary-tree\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u4e8c\\u53c9\\u6811\\u4e2d\\u7b2c\\u4e8c\\u5c0f\\u7684\\u8282\\u70b9\"}]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"196.2K\", \"totalSubmission\": \"260.7K\", \"totalAcceptedRaw\": 196221, \"totalSubmissionRaw\": 260696, \"acRate\": \"75.3%\"}",
"stats": "{\"totalAccepted\": \"203.4K\", \"totalSubmission\": \"269.9K\", \"totalAcceptedRaw\": 203380, \"totalSubmissionRaw\": 269917, \"acRate\": \"75.3%\"}",
"hints": [
"Try to utilize the property of a BST.",
"Try in-order traversal. (Credits to @chan13)",