- 博客(15)
- 收藏
- 关注
原创 爬楼梯问题
有一楼梯共n级,刚开始时你在第一级,若每次只能跨上一级或者二级,要走上n级,共有多少走法?输入:台阶数量 n输出:多少种走法 m问题分析: 此题就是动态规划问题,设走第i层楼梯需要countWay[i]种方法,走第i-1层楼梯需要countWay[i-1]种方法。则走第i+1层楼梯的方法种数为countWay[i-1]+countWay[i]种方法。例如:n=1 1n=2 ...
2018-09-10 16:39:50
858
原创 434. Number of Segments in a String--leetcode
Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.Please note that the string does not contain any non-printable characters.E...
2018-08-22 10:59:16
154
原创 599. Minimum Index Sum of Two Lists --- -leetCode
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.You need to help them find out their common interest with the ...
2018-08-21 17:50:54
112
原创 Write a function that takes an unsigned integer and returns the number of '1' bits it has -leetCode
求解一个无符号整数中1的个数思路:1:采用取模方法求解2:移位运算求解3:java内置函数 bitCount()代码实现:(1)取余int bitCount(int n){ int k; if(n==0)//如果n=0返回0 return 0; int count =0; while(n>=1){ k=...
2018-08-21 15:55:46
915
原创 Binary Search Tree Iterator------leetCode
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and...
2018-08-01 19:46:15
87
原创 debian的基本安装配置
debian的安装配置: 安装网络工具 net-tools ssh 服务 openssh-server apt-get install openssh-server 修改配置文件 sshd_config primitRootLogin yes源配置 /etc/apt/source.list软件卸载 apt-get autoremove 软件名 网络配置 vim /et...
2018-06-26 11:02:54
1950
原创 二叉树的层次遍历
二叉树的层次遍历使用队列的特性,先进先出。void levelOrder(TreeNode root){ Queue(); queue.inQueue(root); while(queue.isNotEmpty()){ TreeNode node=queue.outQueue(); visit(node); if(node->lchild!=null){ ...
2018-04-11 22:00:52
116
原创 二叉树的三种遍历(先序,中序,后序)
二叉树的遍历 1、递归形式的遍历 1.1先序遍历 先访问父亲节点,在访问左叶子节点,在访问右叶子节点,代码如下: void preOrder(TreeNode root){ if(root!=null){ vistit(root); ...
2018-04-11 21:50:08
1244
原创 docker学习 (4)-容器
docker的容器是基于镜像的创建的,即在镜像的基础之上创建一层读写层,但是对于镜像的没有发生变化。 docker容器是轻量级的,可以随时创建和删除。docker容器运行是当容器内的任务完成,容器也就终止运行。1、docker 容器的创建 docker create [镜像名称] 可以直接创建一个处于停止状态的容器,运行这个容器使用docker start 命令启动运行 ...
2018-03-28 14:55:59
133
原创 mysql 字段中 字符串的截取
mysql 字段中 字符串的截取1、left(字段名,index) 从左边开始第index开始截取2、right(字段名,index)从右边开始第index开始截取3、substring(字段名,index)当index>0从左边开始截取直到结束 当index<0从右边开始截取直到结束 当index=0返回空4、substring(字段名,index,len)从index开始,截取...
2018-03-28 14:53:55
4039
原创 docker学习(3)- 镜像
1、docker镜像获取可以从网上获取,例如docker pool 或者docker hub上获取 docker pull [镜像名字][:TAG] docker pull ubtuntu: 14.04 docker pull dl.dockpool.com:5000/debian 2、 docker镜像的信息查看 查看本地
2017-08-15 14:26:10
288
原创 Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.我们列举10以下的自然数且是3
2017-08-09 14:52:08
399
原创 mysql-cluster
mysql-cluster 是一个采用分布式计算环境的高实用、高冗余的mysql版本。它采用了NDB-cluster 存储引擎,允许在1个 Cluster 中运行n个MySQL服务器。mysql-cluster使用分布式的节点结构,因此它解决了数据库单点失效的情况,所以可以很高效的为应用提供数据库服务。
2017-08-08 10:57:49
329
原创 docker 学习(1)
docker是基于go语言开发的一个云开源项目,它的目标是“build,ship and run any app,Anywhere。它基于linux的容器技术(Linux containers),是一个轻量级的容器,可以理解为沙盒。
2017-08-08 10:31:23
234
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人