摘要: 1. 二叉树题目概述 https://leetcode-cn.com/tag/tree/ 页面描述的是“树”的概念,本专题以二叉树题目为主。 2. 典型题目 2.1 二叉树的层序遍历 https://leetcode-cn.com/problems/binary-tree-level-order-t 阅读全文
posted @ 2020-07-06 09:24 不写诗的诗人小安 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1. 数组题目概述 https://leetcode-cn.com/tag/array/ 以下仅挑选若干个仅有“数组”标签的题目,如同时有“数组”、“动态规划”的标签,将纳入“动态规划”专题。 2. 典型题目 2.1 顺时针旋转 n x n 矩阵 https://leetcode-cn.com/pr 阅读全文
posted @ 2020-07-01 09:49 不写诗的诗人小安 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1. OOM-killer简介 2. 如何防止程序被oom-killer杀掉 sudo bash -c "echo '-15' | tee /proc/5641/oom_adj" 3. Reference https://stackoverflow.com/questions/17887228/ho 阅读全文
posted @ 2020-05-31 22:54 不写诗的诗人小安 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 安装 sudo yum install lrzsz 阅读全文
posted @ 2020-05-28 00:08 不写诗的诗人小安 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 验证二进制文件中是否有debug信息,也即编译的时候,是否使用了“-g”选项 objdump --debugging <binary-file> <binary-file>可以是 .o, .a, .so 可执行文件等均可 带了“-g”选项的,会有如下字样 Contents of the .debug 阅读全文
posted @ 2020-05-28 00:04 不写诗的诗人小安 阅读(652) 评论(0) 推荐(0) 编辑
摘要: 1. Ctrl+S关闭输入,Ctrl+Q退出 2. Ctrl+Z程序推至后台,fg恢复前台运行 阅读全文
posted @ 2020-05-28 00:02 不写诗的诗人小安 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 第一,用sort+uniq,注意,单纯uniq是不行的。sort -n test.txt | uniq 第二,用sort+awk命令,注意,单纯awk同样不行,原因同上。 sort -n $file | awk '{if($0!=line)print; line=$0}' 第三,用sort+sed命 阅读全文
posted @ 2020-05-28 00:00 不写诗的诗人小安 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1. 统计项目代码行数 find . "(" -name "*.cc" -or -name "*.cpp" -or -name "*.h" ")" -print | xargs wc -l 2. find & copy find <target-dir> -type f -name "<file-p 阅读全文
posted @ 2020-05-27 23:55 不写诗的诗人小安 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1. 查看硬件信息 cat /proc/cpuinfo # 查看CPU信息 free -h # 查看内存信息 cat /proc/<pid>/status # 查看指定进程的内存信息 df -h # 查看硬盘信息 2. 查看软件信息 cat /etc/redhat-release # 查看OS版本 阅读全文
posted @ 2020-05-27 23:47 不写诗的诗人小安 阅读(135) 评论(0) 推荐(0) 编辑
摘要: https://en.wikipedia.org/wiki/K-means_clustering 阅读全文
posted @ 2020-05-27 23:40 不写诗的诗人小安 阅读(113) 评论(0) 推荐(0) 编辑