Title: leetcode236:二叉树的最近公共祖先 · Issue #43 · sisterAn/JavaScript-Algorithms · GitHub
Open Graph Title: leetcode236:二叉树的最近公共祖先 · Issue #43 · sisterAn/JavaScript-Algorithms
X Title: leetcode236:二叉树的最近公共祖先 · Issue #43 · sisterAn/JavaScript-Algorithms
Description: 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。” 例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4] 示例 1: 输入: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1 输出:...
Open Graph Description: 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。” 例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4] 示例 1: 输入: root = [3,5,1,...
X Description: 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。” 例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4] 示例 1: 输入: root = [3,5,1,...
Opengraph URL: https://github.com/sisterAn/JavaScript-Algorithms/issues/43
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"leetcode236:二叉树的最近公共祖先","articleBody":"给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。\r\n\r\n百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”\r\n\r\n例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4]\r\n\r\n\r\n\r\n**示例 1:**\r\n\r\n```js\r\n输入: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1\r\n输出: 3\r\n解释: 节点 5 和节点 1 的最近公共祖先是节点 3。\r\n```\r\n\r\n**示例 2:**\r\n\r\n```js\r\n输入: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4\r\n输出: 5\r\n解释: 节点 5 和节点 4 的最近公共祖先是节点 5。因为根据定义最近公共祖先节点可以为节点本身。\r\n```\r\n\r\n**说明**:\r\n\r\n- 所有节点的值都是唯一的。\r\n- p、q 为不同节点且均存在于给定的二叉树中。\r\n\r\n附赠leetcode地址:[leetcode](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/solution/javascript236er-cha-shu-de-zui-jin-gong-gong-zu-xi/)","author":{"url":"https://github.com/sisterAn","@type":"Person","name":"sisterAn"},"datePublished":"2020-05-17T14:59:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/43/JavaScript-Algorithms/issues/43"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e8e40afc-a6ba-b3d3-2084-6667f0d65f67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B370:1A500C:12407EB:17C291D:696B1307 |
| html-safe-nonce | e164eaf529d4fbb6af05c27085b58f9e04721d1ea1fd02d71804d3b834718cae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzcwOjFBNTAwQzoxMjQwN0VCOjE3QzI5MUQ6Njk2QjEzMDciLCJ2aXNpdG9yX2lkIjoiODY5MzkwODk4NzQzMTI5MzcwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e2353825d48c8a8a5b5ec356cda0ce498065756cccfb7f4f90ae4f0753d071a8 |
| hovercard-subject-tag | issue:619725114 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sisterAn/JavaScript-Algorithms/43/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e0968af7dfbcedc42fb12a0081cd3ce8c9d95c0bb59b5aea14162f06a173366/sisterAn/JavaScript-Algorithms/issues/43 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e0968af7dfbcedc42fb12a0081cd3ce8c9d95c0bb59b5aea14162f06a173366/sisterAn/JavaScript-Algorithms/issues/43 |
| og:image:alt | 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。” 例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4] 示例 1: 输入: root = [3,5,1,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sisterAn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/sisterAn/JavaScript-Algorithms git https://github.com/sisterAn/JavaScript-Algorithms.git |
| octolytics-dimension-user_id | 19721451 |
| octolytics-dimension-user_login | sisterAn |
| octolytics-dimension-repository_id | 252061924 |
| octolytics-dimension-repository_nwo | sisterAn/JavaScript-Algorithms |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 252061924 |
| octolytics-dimension-repository_network_root_nwo | sisterAn/JavaScript-Algorithms |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width