摘要: Reverse a singly linked list.代码如下:the iterative solution:(c++)/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNo... 阅读全文
posted @ 2015-06-19 22:15 小金乌会发光-Z&M 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文
posted @ 2015-06-17 22:35 小金乌会发光-Z&M 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1即反转二叉树,代码如下:/** * Definition for a bina... 阅读全文
posted @ 2015-06-16 11:30 小金乌会发光-Z&M 阅读(441) 评论(0) 推荐(0) 编辑
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 ... 阅读全文
posted @ 2015-06-14 22:57 小金乌会发光-Z&M 阅读(212) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2015-06-12 21:01 小金乌会发光-Z&M 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 1、方便获取图标的网站: http://www.easyicon.cn/ 2、百度网盘搜索引擎: http://www.pan1234.com/ 3、鸡啄米:C++编程入门系列之目录和总结: http://www.jizhuomi.com/software/129.html 4、牛客网:http:/ 阅读全文
posted @ 2015-06-12 16:07 小金乌会发光-Z&M 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ... 阅读全文
posted @ 2015-06-11 14:18 小金乌会发光-Z&M 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 要求:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive inte... 阅读全文
posted @ 2015-06-10 16:29 小金乌会发光-Z&M 阅读(263) 评论(0) 推荐(0) 编辑
摘要: PHP经典面试题:(不断跟进补充中。。。)1、用PHP打印出前一天的时间格式是2009-02-1022:21:21(2分)echodate('Y-m-dH:i:s',strtotime('-1day'));或者$yesterday=time()-(24*60*60);echo'today:'.dat... 阅读全文
posted @ 2015-06-09 20:11 小金乌会发光-Z&M 阅读(459) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2015-06-09 13:34 小金乌会发光-Z&M 阅读(209) 评论(0) 推荐(0) 编辑