- 博客(10)
- 收藏
- 关注
转载 tree algorithm without recursion
【前言】树的遍历,根据访问自身和其子节点之间的顺序关系,分为前序,后序遍历。对于二叉树,每个节点至多有两个子节点(特别的称为左,右子节点),又有中序遍历。由于树自身具有的递归性,这些遍历函数使用递归函数很容易实现,代码也非常简洁。借助于数据结构中的栈,可以把树遍历的递归函数改写为非递归函数。 在这里我思考的问题是,很显然,循环可以改写为递归函数。递归函数是否借助栈这种数据结构改写为...
2018-12-31 15:06:13 148
转载 sort algorithm
十大经典排序算法(动图演示) 0、算法概述 0.1 算法分类 十种常见排序算法可以分为两大类: 非线性时间比较类排序:通过比较来决定元素间的相对次序,由于其时间复杂度不能突破O(nlogn),因此称为非线性时间比较类排序。 线性时间非比较类排序:不通过比较来决定元素间的相对次序,它可以突破基于比较排序的时间下界,以线性时间运行,因此称为线性时间非比较类排序。 0.2 算法复杂...
2018-12-31 14:06:19 912
转载 stat /bin/bash: no such file or directory
docker exec -it 029e6df30836 /bin/bash exec: “/bin/bash”: stat /bin/bash: no such file or directory 我们一般可能会在容器启动后进入容器,常用的是docker attach 镜像id,但是启动镜像的时候如果没有带 参数 -it的话,attach进去后可能是日志界面,并不能执行命令。所以我们会...
2018-12-31 09:53:36 9011
原创 docker-compose
refer https://www.cnblogs.com/linjiqin/p/8849432.html. up -d : launch deamon ps : process list logs name : log detail stop : pause restart kill : close rm : remove ...
2018-12-30 15:21:42 173
原创 ll -a | grep a |awk '{print $1,$3}' >> awk.txt
1, list all files info in current dir, match a in every column content. 2,format output column1 and column 3 to file awk.txt. Hopely help u easily to learn shell comand! more Info about awk to offic...
2018-12-30 09:21:39 1416
原创 xargs == `` + more flexible
1 rm `find /path -type f` 如果path目录下文件过多就会因为“参数列表过长”而报错无法执行。但改用xargs以后,问题即获解决。 1 find /path -type f -print0 | xargs -0 rm 本例中xargs将find产生的长串文件列表拆散成多个子串,然后对每个子...
2018-12-30 08:44:25 165
原创 ls|xargs-t-I{} mv {} {}.old
U can make it clear to refer office instruction.Here I simplely to explain the meaning of the cmd. 1,pipe | Std IO , from left to right as args(just think so ) 2 xargs specify left cmd file n...
2018-12-30 08:37:04 3477
原创 微服务整合 注册中心 配置中心 认证中心 网关 监控中心
fork了https://github.com/babylikebird/Micro-Service-Skeleton 新增了配置中心。 代码地址: https://github.com/DavidKingCN/Micro-Service-Skeleton 获取token
2018-12-23 19:48:00 2746 2
原创 shell install 3 nodes k8s
# change time zone cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime timedatectl set-timezone Asia/Shanghai rm /etc/yum.repos.d/CentOS-Base.repo cp /vagrant/yum/*.* /etc/yum.repos.d/ mv /etc/yum.re...
2018-12-03 10:15:54 203
原创 sed uage
sed -e "s|##ETCD_NODES##|${ETCD_NODES}|" -e "s/##NODE_NAME##/${NODE_NAMES[0]}/" -e "s/##NODE_IP##/${NODE_IPS[0]}/" etcd.service.template > etcd-${NODE_IPS[0]}.service note: if replace content cont...
2018-12-02 12:02:24 118
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人