原创 平衡二叉樹的的插入
平衡二叉樹的建立: #include <iostream> #include <vector> #include <map> using namespace std; struct TreeNode { int val;
原创 Permutations
Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations
原创 1089. Insert or Merge (25)
1089. Insert or Merge (25) 時間限制 200 ms 內存限制 65536 kB 代碼長度限制 16000 B 判題程序 Standard 作者 CHEN, Yue Accordi
原创 Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid
原创 Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1
原创 Unique Binary Search Trees
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, th
原创 Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read
原创 Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the node
原创 Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of
原创 Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with
原创 Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n
原创 Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of n
原创 Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3},
原创 Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values alon
原创 Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. /** * De