摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2020-05-25 22:11 苗妙苗 阅读(104) 评论(0) 推荐(0)
摘要: Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Input: 1 / \ 2 3 \ 5 Output: ["1->2->5", "1->3"] 阅读全文
posted @ 2020-05-25 10:43 苗妙苗 阅读(115) 评论(0) 推荐(0)