自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (1)
  • 收藏
  • 关注

原创 【编程题】01串排序

题目给定一个01串(仅由‘ 0’或‘1’组成的字符串),现在想把这个数字串排序成“非递减”有序序列,请问至少需要多少次交换(任意两个位置交换)? 输入描述: 输入数据第一行是一个正整数T(T<=100),表示有T组测试数据; 接下来的T行,每行给出01串。 数据保证—— 50%的字符串长度在[1,100 ] 95%的字符串长度在[1,10000] 100%的字符串长度在[1,1000

2015-06-27 19:38:25 4614

原创 leetcode Edit Distance

题目Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:a)

2015-06-22 21:57:56 1640

原创 leetcode House Robber II

题目Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, a

2015-06-21 21:12:14 1661

原创 leetcode House Robber

题目You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent hous

2015-06-21 20:03:32 1716

原创 leetcode Interleaving String

题目Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: s1 = “aabcc”, s2 = “dbbca”,When s3 = “aadbbcbcac”, return true. When s3 = “aadbbbaccc”, return fal

2015-06-21 19:35:21 1605

原创 leetcode Longest Valid Parentheses

题目Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “(()”, the longest valid parentheses substring is “()”, which h

2015-06-21 15:46:11 1620

原创 leetcode Maximal Square

题目Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area.For example, given the following matrix:1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Re

2015-06-20 21:33:33 1628

转载 /proc/meminfo

cat /proc/meminfo 读出的内核信息进行解释,下篇文章会简单对读出该信息的代码进行简单的分析。MemTotal: 507480 kB MemFree: 10800 kB Buffers: 34728 kB Cached: 98852 kB SwapCached: 128 kB Active:

2015-06-15 17:49:39 1775

原创 linux内存之free used buffer cach

第一行Mem: total(96679)表示系统中物理内存总量。 used(1631)表示已经分配的物理内存。 free(95048)表示尚未分配的物理内存。 shared(0)表示共享内存。 buffers(196)表示分配给用作buffer的内存。 cached(283)表示分配给用作cached的内存。 第二行: -buffers/cache(1151): 第一行中的used

2015-06-12 17:07:04 6256

原创 linux /proc/pid/smaps各字段含义

/proc/$PID/smaps 第一行: 08048000-080bc000 地址空间的开始地址 - 结束地址 r-xp 属性。前三个是rwx(读、写、可执行),如果不具有则为“-”。最后一个是p/s(私有/共享) 00000000 偏移量。如果这段内存是从文件里映射过来的,则偏移量为这段内容在文件中的偏移量。如果不是从文件里面映射过来的则为0. 03:02 If the

2015-06-10 20:03:09 25666

原创 今天执行grep命令差点把服务器搞崩

grep “rst” -r ./ >> a.log 今天执行这个命令差点把服务器搞崩了。 本意是查找所有源代码文件中含有rst字符串的行,打印到文件a.log中,然后进行分析。 这句grep命令会搜索当前目录下所有的带rst字符串的行,并将结果打印到a.log中。但是,a.log本身也在当前目录下,形成了死循环回路。 更要命的是,由于源代码文件数量庞大,自以为是由于grep命令处理的文

2015-06-04 22:01:24 2991

原创 leetcode Pow(x, n)

题目Implement pow(x, n).题目来源:https://leetcode.com/problems/powx-n/分析如何求x的n次幂呢? x的0次幂等于1,x的负数次幂等于正数次幂的倒数。有个注意点,INT_MAX = 2147483647而INT_MIN = -2147483648。所以,x的INT_MIN次幂等于x的(INT_MAX + 1)次幂的倒数。 在求幂的时候一个一个

2015-06-03 11:55:37 2189

原创 leetcode Implement strStr()

题目Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02): The signature of the function had been updated to ret

2015-06-02 20:16:39 1597

原创 leetcode Valid Parentheses

题目Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all valid but

2015-06-02 18:40:34 1654

原创 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 cases

2015-06-02 18:13:17 1595

原创 leetcode Word Search II

题目Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizo

2015-06-01 09:12:13 1710

遗传算法实例(python实现)

用python实现的遗传算法的一个实例 求函数f x 10 sin 5x + 7 cos 4x 0 &lt; x &lt; 10的最大值

2014-04-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除