原创 leetcode Max Points on a Line(*)
Given n points on a 2D plane, find the maximum number of points that lie
原创 LeetCode Divide Two Integers(***)
Divide two integers without using multiplication, division and mod operator. 用移位操作實現乘以2、除以2,對除數進行翻倍的擴大操作,記錄翻倍次數,
原创 leetcode Next Permutation(*)
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
原创 leetcode LRU Cache(**)
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:
原创 leetcode Evaluate Reverse Polish Notation(*)
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operan
原创 leetcode Populating Next Right Pointers in Each Node(*)
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNod
原创 leetcode Reorder List(*)
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place witho
原创 leetcode Linked List Cycle(I II)(*)
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 最基本的用快
原创 leetcode Sort List(**)
Sort a linked list in O(n log n) time using constant space complexity. O(nlogn)的有快速排序,歸併排序,堆排序。這裏需要採用歸併排序。把一個鏈表
原创 CareerCup Chapter 9 Sorting and Searching
9.1 You are given two sorted arrays, A and B, and A has a large enough buffer at the end to hold B. Write a method to m
原创 leetcode Valid Sudoku(*)
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled,
原创 leetcode Best Time to Buy and Sell Stock(I~III)(*)
I: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitte
原创 leetcode Count and Say(*)
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read of
原创 leetcode Symmetric Tree(*)
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this bina
原创 LeetCode Palindrome Partitioning II(***)
Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts need