上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-01-21 14:49 Eason Liu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目描述:写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。输入:输入可能包含多个测试样例。对于每个测试案例,输入为两个整数m和n(1 2 3 int add(int a, int b) { 4 int n1, n2; 5 do { 6 ... 阅读全文
posted @ 2015-01-21 13:26 Eason Liu 阅读(508) 评论(0) 推荐(0) 编辑
摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文
posted @ 2015-01-20 22:42 Eason Liu 阅读(1654) 评论(0) 推荐(0) 编辑
摘要: 说到C/C++函数参数读取顺序,很多人都知道在入栈时是从右至左的,可是真的有那么简单吗?先看一个例子:1 #include 2 3 int main() {4 int a = 10;5 printf("%d %d %d\n", a++, ++a, a);6 return 0;... 阅读全文
posted @ 2015-01-14 15:46 Eason Liu 阅读(8608) 评论(2) 推荐(4) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-01-13 17:02 Eason Liu 阅读(2782) 评论(0) 推荐(0) 编辑
摘要: 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 should p... 阅读全文
posted @ 2015-01-12 16:56 Eason Liu 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion1.Ifversion1>version2return 1, ifversion1 val2) return 1;26 if (val1 < val2) return -1;27 ... 阅读全文
posted @ 2015-01-12 15:49 Eason Liu 阅读(3580) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文
posted @ 2015-01-12 14:05 Eason Liu 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf... 阅读全文
posted @ 2015-01-12 13:40 Eason Liu 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially... 阅读全文
posted @ 2015-01-12 13:24 Eason Liu 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页