Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-04-29 22:40:00
阅读次数:
438
2014-04-28 23:35题目:最大子数组和问题。解法:O(n)解法。代码: 1 //
17.8 Find the consecutive subarray with maximum sum in an array. 2 // O(n)
online algorithm. 3 #include...
分类:
其他好文 时间:
2014-04-29 16:35:28
阅读次数:
429
2014-04-28
23:52题目:设计算法,找出一本书中某个单词的出现频率。解法:数就行了。代码: 1 // 17.9 Given a book, find out the
occurrences of any given words in it. 2 // Answer: 3 // 1....
分类:
其他好文 时间:
2014-04-29 16:00:32
阅读次数:
388
fstab修改错误了如何修复当你不小心把磁盘表输入错误以后,系统总是让你按ctrl+D重新启动或者输入密码进入shell,你输入密码登陆后,编辑文件是只读的,执行下面的命令后就可以编辑了。mount
-o remount,rw /vi /etc/fstab删除错误的磁盘信息,重启就好了。
分类:
其他好文 时间:
2014-04-29 15:10:14
阅读次数:
349
2014-04-29
00:04题目:给定一个整数数组,找出所有加起来为指定和的数对。解法1:可以用哈希表保存数组元素,做到O(n)时间的算法。代码: 1 // 17.12
Given an array of integers and target value, find all pairs in ...
分类:
其他好文 时间:
2014-04-29 15:08:13
阅读次数:
469
2014-04-29
03:05题目:给定一个词典,其中某些词可能能够通过词典里其他的词拼接而成。找出这样的组合词里最长的一个。解法:Leetcode上有Word
Break这道题,和这题基本思路一致。代码: 1 // 18.7 Given a list of words, find out the...
分类:
其他好文 时间:
2014-04-29 14:30:17
阅读次数:
493
2014-04-29
02:27题目:找出10亿个数中最小的100万个数,假设内存可以装得下。解法1:内存可以装得下?可以用快速选择算法得到无序的结果。时间复杂度总体是O(n)级别,但是常系数不小。代码:
1 // 18.6 Find the smallest one million number....
分类:
其他好文 时间:
2014-04-29 14:27:13
阅读次数:
665
1#!/bin/bash
-2#===============================================================================3#4#FILE:
condition_expression_test.sh5#6# USAGE: ./con...
分类:
其他好文 时间:
2014-04-29 10:15:46
阅读次数:
426
使用公钥登录OpenSSH2013年10月24日16:47 生成密钥对
我所知道的,有三种生成密钥对的工具,分别为GNU/Linux下的ssh-keygen命令、puttygen、SSH Secure Shell。
使用ssh-keygen生成密钥对 [root@ld365 ~]# ssh-keyg...
分类:
其他好文 时间:
2014-04-29 10:11:47
阅读次数:
615
可以通过man
test来查看文档,下面的文章转自http://m.blog.csdn.net/blog/yuanjungogogo/9222875#!/bin/shmyPath="/var/log/httpd/"myFile="/var
/log/httpd/access.log"# 这里的-x ...
分类:
其他好文 时间:
2014-04-29 09:27:45
阅读次数:
446