摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: 题意 给定一数n,求1-n所组成的所有可能的BST树的集合 题解 阅读全文
posted @ 2019-02-24 22:08 TobicYAL 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. Example: 1 class Solution { 2 public: 3 void build(TreeNode*root, vector<int>& 阅读全文
posted @ 2019-02-24 21:39 TobicYAL 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: 1 class Solution { 2 public: 3 ListNode* rev 阅读全文
posted @ 2019-02-24 21:29 TobicYAL 阅读(135) 评论(0) 推荐(0) 编辑