原创 LeetCode.189 Rotate Array
Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] a
原创 136. Single Number
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algor
原创 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 101. Symmetric Tree (對稱二叉樹) 108. Convert Sorted Array To BST(二叉搜索樹)
101. Symmetric Tree (對稱二叉樹) Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its cente
原创 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 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-69 Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
原创 java學習隨筆
eclipse 的一些快捷鍵: ctrl+1 快捷修復 ctrl+d 快捷刪除行 shift+enter 換行 ctrl+f11 快速運行項目 alt+↑/↓ 快速移動行 ctrl+m 放大工作區 ctrl+shift+r:打開資源 ct
原创 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to c
原创 LeetCode 88 Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elemen
原创 125 Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For
原创 C++與STL入門
今天學的一點C++知識 1.c++版本框架: c++頭文件: stdio.h -> cstdio string -> cstring math.h -> cmath ctype.h -> cctype c++ 程序 加
原创 LeetCode - Same Tree 100
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same
原创 LeetCode 111. Minimum Depth of Binary
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the
原创 LeetCode 67 - Add Binary
Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains on