2019年1月22日

[LeetCode_96] Unique Binary Search Trees

摘要: 题目链接 https://leetcode.com/problems/unique binary search trees/ 题意 计算给定节点数的BST有多少种 思路 递归 相关知识 二叉搜索树(Binary Search Tree ,BST) A BST is defined as follow 阅读全文

posted @ 2019-01-22 20:56 coding_gaga 阅读(277) 评论(0) 推荐(0) 编辑

[LeetCode_105]Construct Binary Tree from Preorder and Inorder Traversal

摘要: 题目链接 https://leetcode.com/problems/construct binary tree from preorder and inorder traversal/ 题意 由二叉树的先序遍历和中序遍历建树 思路 理解建树过程;使用递归,递归关键:清楚递归过程,明确函数参数、返回 阅读全文

posted @ 2019-01-22 12:08 coding_gaga 阅读(142) 评论(0) 推荐(0) 编辑

导航