摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off ... 阅读全文
posted @ 2015-03-20 16:23 hongchun_z 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word ... 阅读全文
posted @ 2015-03-20 15:38 hongchun_z 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100";思路: 对齐, 计算当前位和进位;如果位较长,让我想到了先行进位加法器,不过这里的计算不... 阅读全文
posted @ 2015-03-20 10:39 hongchun_z 阅读(131) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you cli... 阅读全文
posted @ 2015-03-19 20:58 hongchun_z 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array. Note:You may assume that A has enough space (size that is greater or equa... 阅读全文
posted @ 2015-03-19 19:34 hongchun_z 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1. 在Linux系统中,以 文件 方式访问设备 。2. Linux内核引导时,从文件/etc/fstab中读取要加载的文件系统。3. Linux文件系统中每个文件用i字节来标识。4. 全部磁盘块由四个部分组成,分别为引导块、i字节表块、专用块、数据储存块。5. 链接分为: 硬链接 和 符号链接 。... 阅读全文
posted @ 2015-03-19 11:29 hongchun_z 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 转八大排序算法概述排序有内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存。我们这里说说八大排序就是内部排序。当n较大,则应采用时间复杂度为O(nlog2n)的排序方法:快速排序、堆排序或归并排序序。 快速排序:... 阅读全文
posted @ 2015-03-18 20:46 hongchun_z 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2015-03-18 17:36 hongchun_z 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-03-18 14:59 hongchun_z 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,... 阅读全文
posted @ 2015-03-18 14:41 hongchun_z 阅读(119) 评论(0) 推荐(0) 编辑