摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2015-08-12 16:07 小金乌会发光-Z&M 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 作为安装程序的Setup文件是软件的开发者专门为其软件设计的.exe文件,是当前最为盛行的安装程序。在运行该Setup文件进行软件安装时,Setup除了进行复制、改名、解压和目录维护等基本安装工作外,还要对系统进行必要的配置,通常是修改config.sys、autoexec.bat和注册表等文件,以 阅读全文
posted @ 2015-08-09 12:16 小金乌会发光-Z&M 阅读(3104) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion10.01代码如下:class Solution { public: int compareVersion(strin... 阅读全文
posted @ 2015-08-04 22:02 小金乌会发光-Z&M 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-07-30 22:36 小金乌会发光-Z&M 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-07-29 22:25 小金乌会发光-Z&M 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving(检索) the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Rem... 阅读全文
posted @ 2015-07-28 22:29 小金乌会发光-Z&M 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2015-07-26 14:55 小金乌会发光-Z&M 阅读(422) 评论(0) 推荐(0) 编辑
摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析:题意即为 阶乘尾部的零(求n!中尾部为0的个数)思路... 阅读全文
posted @ 2015-07-26 13:31 小金乌会发光-Z&M 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文
posted @ 2015-07-19 13:13 小金乌会发光-Z&M 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文
posted @ 2015-07-19 11:05 小金乌会发光-Z&M 阅读(207) 评论(0) 推荐(0) 编辑