摘要: 正常安装就是RTFD就行了,不行辅助这几个链接也行: 我先把整个脚本[1]放这里: 上面这个在分区的时候,我的分区习惯是这样的: 用parted: 这个排版是真尼玛。。。。 这里大概说一下,设了一个100M的boot,然后1G的交换分区,然后剩下的全是/了。 在parted里面p查看一下,然后q退出 阅读全文
posted @ 2016-04-28 00:58 Tiny-Box 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 前两天在群里跟人讨论到写库时对于lambda和function的取舍,跑了写测试查了些资料后基本得出结论:如果没有自由变量的情况下,一般不要用function。如果有自由变量的话,C++中的lambda就是一个匿名类的实例,而如果没有的话,就是一个单纯的函数指针。为什么说尽量不要用function呢... 阅读全文
posted @ 2015-03-25 20:35 Tiny-Box 阅读(2617) 评论(0) 推荐(0) 编辑
摘要: 这个题目是典型的KMP算法,当然也可以试试BM,当然有关KMP和BM的介绍阮一峰曾经写过比较好的科普,然后july也有讲解,不过那个太长了。 先放题目吧: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of hays... 阅读全文
posted @ 2014-12-02 15:43 Tiny-Box 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 这道题目被放在的简单的类别里是有原因的,题目如下: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character '.'. A... 阅读全文
posted @ 2014-12-02 15:19 Tiny-Box 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 这个还是一开始没读懂题目,题目如下: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 ... 阅读全文
posted @ 2014-11-26 00:04 Tiny-Box 阅读(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 does not ex... 阅读全文
posted @ 2014-11-25 23:55 Tiny-Box 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 这个非常简单的题目,题目如下: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 就是算导里面的第一个算法讲解,但是我的C++水平实在太渣,所以对于链表的操作很蠢,... 阅读全文
posted @ 2014-11-24 23:30 Tiny-Box 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 这个题目相对有点奇怪,题目如下: Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 可能是我思路的问题吧,我之前是在考虑先将string转成int或者double,然后将二进制转为十进制进行计算,最后再将这个十进制转为二进... 阅读全文
posted @ 2014-11-24 23:26 Tiny-Box 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 这道题其实让我意识到了我的英文水平还有待加强。。。。题目如下:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that t... 阅读全文
posted @ 2014-11-23 22:59 Tiny-Box 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 这道题leetcode上面写着是DP问题,问题是我一开始写了个简单的递归结果直接超时,所以没办法只好拿迭代来做了。题目如下: 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 w... 阅读全文
posted @ 2014-11-23 22:50 Tiny-Box 阅读(207) 评论(0) 推荐(0) 编辑