摘要: class Solution {public: bool isPalindrome(int x) { if (x =0; i--) { int a = n / tens; int b = n % 10; n = n... 阅读全文
posted @ 2014-07-18 23:38 卖程序的小歪 阅读(229) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: vector generateParenthesis(int n) { string str; vector res; dfs(n, 0, 0, str, res); return res;... 阅读全文
posted @ 2014-07-18 18:46 卖程序的小歪 阅读(160) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int maxSubArray(int A[], int n) { int cur_sum = 0; int max_sum = INT_MIN; for (int i=0; i max_... 阅读全文
posted @ 2014-07-18 18:40 卖程序的小歪 阅读(144) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: void setZeroes(vector > &matrix) { int rows = matrix.size(); int cols = matrix[0].size(); bool... 阅读全文
posted @ 2014-07-18 15:52 卖程序的小歪 阅读(139) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *removeNthFromEnd(ListNode *head, int n) { if (head == NULL) return NULL; ListNode* pre = NULL; ... 阅读全文
posted @ 2014-07-18 14:36 卖程序的小歪 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 有时候需要一个独立的块设备,loop设备是个方便的选择,可通过如下方式创建dd if=/dev/zero of=./loopback_file bs=1M count=1000losetup /dev/loop0 ./loopback_file首先建立一个指定大小的文件作为实际存储的空间,然后将其与... 阅读全文
posted @ 2014-07-18 00:45 卖程序的小歪 阅读(1002) 评论(0) 推荐(0) 编辑