摘要:
reference:http://fuxueliang.com/tech/2013/05/26/java-sorting-comparator-vs-comparable-tutorial/ 阅读全文
摘要:
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up... 阅读全文
摘要:
Find the K closest points to the origin in a 2D plane, given an array containing N points.看到K神马的基本上就是min/max heap.http://stackoverflow.com/questions/2... 阅读全文
摘要:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num... 阅读全文
摘要:
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
摘要:
reference: http://www.iteye.com/topic/1130373 阅读全文
摘要:
题目:Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You shoul... 阅读全文
摘要:
题目:Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.思路:固定一点,计算每一条经过这个店的直线斜率,用一个hashmap记录。记录下最多的斜率个数。对每... 阅读全文
摘要:
Given two words (beginWordandendWord), and a dictionary's word list, find all shortest transformation sequence(s) frombeginWordtoendWord, such that:On... 阅读全文
摘要:
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), the plus+or minus... 阅读全文