上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 46 下一页
摘要: class Solution {public: vector > subsetsWithDup(vector &S) { int len = S.size(); vector > res; vector subset; if (len ... 阅读全文
posted @ 2014-07-19 09:03 卖程序的小歪 阅读(144) 评论(0) 推荐(0) 编辑
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?class Solution {pub... 阅读全文
posted @ 2014-07-19 00:52 卖程序的小歪 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: 有些使用需要进行文件系统的大小调整,比如使用LVM,或者在loopback设备上建立文件系统等,但该文件系统不是根文件系统时可以通过一下步骤,简单的进行:e2fsck -f /dev/loop0resize2fs /dev/loop0 900M这里使用的块设备为/dev/loop0,调整大小为900... 阅读全文
posted @ 2014-07-17 23:02 卖程序的小歪 阅读(792) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: int queen_num; int total;public: int totalNQueens(int n) { queen_num = n; total = 0; vector h(n... 阅读全文
posted @ 2014-07-17 19:53 卖程序的小歪 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 46 下一页