{"version":"1.0","title":"Least Common Ancestor O(d) time and O(1) space","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftmaehara-algorithm.hatenablog.com%2Fentry%2F2021%2F11%2F17%2F040124\" title=\"Least Common Ancestor O(d) time and O(1) space - TM&#39;s memo\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://tmaehara-algorithm.hatenablog.com/","height":"190","type":"rich","width":"100%","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","description":"\u6728\u306e\u9802\u70b9 $u$, $v$ \u306b\u3064\u3044\u3066\u6700\u5c0f\u5171\u901a\u5148\u7956 (LCA) \u3092\u8a08\u7b97\u3059\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u7d39\u4ecb\u3057\u307e\u3059\uff0e\u8907\u6570\u306e\u9802\u70b9\u306e\u7d44\u306b\u5bfe\u3057\u3066 LCA \u3092\u6c42\u3081\u308b\u306e\u3067\u3042\u308c\u3070\uff0c\u6728\u3092\u524d\u51e6\u7406\u3092\u3057\u3066\u30af\u30a8\u30ea\u3042\u305f\u308a $O(\\log n)$ \u306a\u308a $O(1)$ \u3067\u6c42\u3081\u308b\u306e\u304c\u5b9a\u77f3\u3067\u3059\u304c\uff0c\u3053\u3053\u3067\u306f\u305d\u3046\u3067\u306a\u304f\uff0c\u7dda\u5f62\u6642\u9593\u304b\u3051\u3066\u6c42\u3081\u308b\u3053\u3068\u3092\u8003\u3048\u307e\u3059\uff0e\u6728\u306f\u89aa\u30dd\u30a4\u30f3\u30bf parent: &[Option<usize>] \u306b\u3088\u3063\u3066\u4e0e\u3048\u3089\u308c\u308b\u3068\u3057\u307e\u3059\uff0e O(n) \u6642\u9593 O(n) \u7a7a\u9593\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0 \u3059\u3050\u306b\u601d\u3044\u3064\u304f\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u9802\u70b9\u306b\u8a2a\u554f\u6e08\u307f\u304b\u3069\u3046\u304b\u3092\u3042\u3089\u308f\u3059\u30d5\u30e9\u30b0\u3092\u3082\u305f\u305b\u3066\u5404\u9802\u70b9\u304b\u3089\u89aa\u65b9\u5411\u306b\u8d70\u67fb\u3059\u308b\u3082\u306e\u3067\u3057\u3087\u3046\uff0e\u3053\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u9818\u57df\u306e\u78ba\u4fdd\u306b\u2026","published":"2021-11-17 04:01:24","author_name":"maehara","blog_title":"TM's memo","author_url":"https://blog.hatena.ne.jp/maehara/","categories":[],"url":"https://tmaehara-algorithm.hatenablog.com/entry/2021/11/17/040124"}