摘要:
Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: 题意 给定一数n,求1-n所组成的所有可能的BST树的集合 题解 阅读全文
摘要:
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>& 阅读全文
摘要:
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 阅读全文