- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 leetcode Permutations
Permutations回字的四种写法,我直接next Permutation这个分析的很好http://blog.csdn.net/tuantuanls/article/details/8717262
2014-03-08 15:43:47 6195
原创 leetcode Next Permutation
Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as
2014-03-08 15:18:00 690
转载 leetcode Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"32/
2014-03-06 00:01:43 496
原创 leetcode Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字 1 5 10 50 100 500 1000 I V X L
2014-03-04 23:01:54 493
原创 leetcode String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2014-03-04 22:03:56 467
原创 leetcode Add Two Numbers
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two number
2014-03-04 21:33:10 532
原创 leetcode
100msint lengthOfLongestSubstring(string s) { if (s.empty()) return 0; int i, j, len, max_len, n; max_len = 1; int all_chars[26] = {0};
2014-03-01 21:42:48 454
原创 ubuntu设置
系统时间的同步1. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime【设定上海为localtime】2. 执行常规: sudo ntpdate cn.pool.ntp.org
2013-11-17 00:56:28 425
转载 flexible array member
typedef struct{int a; char data[]; // 以前也写成 char data[0], 这个写法更规范} my_data;sizeof(my_data) = 4; flexible array memberC语言的经典写法#define offsetof(type, element) ((int)&((type *
2013-10-05 16:18:21 702
原创 gtest
最近用到gtest,在自己的ubuntu下装了一个./configuresudo make【有的时候需要root权限】make install失败,由于只是使用库,所有无所谓可以动态链接就可以。1. /etc/ld.so.conf添加gtest的lib路径,然后ldd【以前好像是这样,没有验证】2. 暴力方法 把gtest/include
2013-06-05 23:36:31 401
转载 win7 权限
SCRT的session文件修改总是被 denied;win7权限很不习惯网上找的方案,已验证方法一:在程序本身设置在要运行的程序图标上右键,选择“属性”。切换到“兼容性”选项卡,在“特权等级”栏,勾选“以管理员身份运行此程序”,然后按“确定”。方法二:在程序快捷方式上设置属性在“快捷方式”选项卡下,单击“高级”按钮。在“高级属性”对话框中,勾选“用管理
2013-05-26 13:56:51 433
原创 ubuntu
记录工作、学习中的点滴ubuntu遇到一系列问题,做个记录。1. 新装的ubuntu虚拟E: Unable to locate package ctags原来是 apt-get的问题,只需要 sudo apt-get update就可以了2. ssh的安装,搜的靠谱,经过验证的Ubuntu下开启SSH服务1.方法如下: sud
2013-05-19 10:52:04 1783
原创 find 3 indexes
陈利人老师的新浪微博面试题/*===============================================================** Author: lizhao(clark)** E-mail: lzclark27@gmail.com** company: ** Last modified: 2013-03-28 10:30** Filen
2013-03-28 10:54:09 485
原创 gdb调试
一些常用的GDB命令 print i //打印变量idisplay i //一直打印iundisplay //取消br 132 if i==21 //在132设置断点,当i=21时info br //显示当前的断点信息更多信息gdb --help或者gdb下的help
2013-01-12 01:05:58 239
原创 虚拟机设置
1.重启网卡ubuntu:sudo /etc/init.d/networking restart2. IP设置vi /etc/network/interfacesauto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 192.168.1.111netma
2013-01-02 17:25:40 249
转载 adobe flash(转载)
Adobe Flash是几乎每个浏览器上都会安装 的插件,可以用来浏览常见的flash视频内容。较新版本的flash都具有p2p功能,当使用浏览器查看单个视频内容时,会产生大量p2p流量,无论是在家里还是在公司,都会有对紧张的带宽产生严重影响。许多情况下,尤其会导致家庭adsl用户闪断或卡顿 如何禁用Adobe这种垃圾公司出的的这种垃圾功能呢?虽然Adobe 提供了全局禁用p2p功能,但许
2012-12-25 14:47:07 431
原创 netstat
查找使用8010端口的进程 netstat -anp |grep 8010也可以查找 IP netstat -apn |grep '192.168.122.1'-a, --all, --listening display all sockets -p, --programs display PID/Program name for
2012-12-20 11:18:20 305
原创 awk常用技巧
find . -name "*server*" -exec wc -l {} \; |awk 'BEGIN {a="0"} {print $1; a+=$1;} END{print "total="a}'
2012-12-19 17:00:30 342
原创 我的vim设置
Unix/Linux er的常规编辑器vi,emacs。楼猪比较习惯使用vi。我对编辑器的要求比较少:语法高亮;显示行号;对齐;文件头显示作者、时间等信息显示本文件的函数,宏等; 可以在函数定义、函数调用之间切换使用分三部分来说:1.vi的常用命令插入i【在前】,a【在后】删除d dw单词, dd一行, D本行光标以后删除多行 n, md 4,
2012-12-10 16:13:17 5042
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人