原创 117. Populating Next Right Pointers in Each Node II

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Popula

原创 Leetcode-114. Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5

原创 Leetcode-116. Populating Next Right Pointers in Each Node

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Popula

原创 Leetcode-115. Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a stri

原创 Leetcode-113. Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is

原创 Leetcode-112. 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 along t

原创 Leetcode-111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the

原创 Leetcode-110. Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as:

原创 Leetcode-109. 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. For this

原创 Leetcode-107. Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by

原创 Leetcode-108. Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a h

原创 從Kaggle上Titanic比賽引出的各類分類器模型基本方法(未完)

在Titanic生存預測的例子中,在模型融合之前運用到了多個基分類器模型,對特徵進行了篩選。這裏大概用到了RandomForest、AdaBoost、ExtraTrees、GBDT、DecisionTree、KNN、SVM 等7個模型,而

原创 Leetcode-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, ther

原创 Leetcode-Same Tree

Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same

原创 Leetcode-Largest Rectangle in Histogram

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area