摘要:
1.docker images 列出所有的镜像 2.docker run -it --name xxx 容器的唯一标识 /bin/bash 运行容器 3.-v 数据卷映射 -p端口映射 -e 环境变量 4.docker ps 查看正在运行的容器(-a 查看全部容器) 5.docker 命令行变量:$ 阅读全文
posted @ 2021-05-24 11:17
菜鸟哟
阅读(57)
评论(0)
推荐(0)
摘要:
####反转链表public static void fanlian(Node node){ Node pre =null; Node next =null; while (node!=null){ next = node.getNext(); node.setNext(pre); pre=node 阅读全文
posted @ 2021-05-24 11:10
菜鸟哟
阅读(50)
评论(0)
推荐(0)
摘要:
#####获得链表倒数第k个结点public static Node getK(Node node,int k){ List<Node> list = new ArrayList(); while (node!=null){ list.add(node); node=node.getNext(); 阅读全文
posted @ 2021-05-24 11:02
菜鸟哟
阅读(65)
评论(0)
推荐(0)
摘要:
#####输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变public static void test4(){ int[]arry ={1,2,3,4,5}; int j=0; i 阅读全文
posted @ 2021-05-24 10:47
菜鸟哟
阅读(39)
评论(0)
推荐(0)
摘要:
####二进制中一的个数public static int test3(int n){ int count =0; while (n!=0){ n=n&n-1; count++; } return count;} 阅读全文
posted @ 2021-05-24 10:14
菜鸟哟
阅读(71)
评论(0)
推荐(0)
摘要:
#####青蛙一次可以跳1,2,3***,n个台阶,问有多少种跳法public static int test1(int n){ int res=0; if (n<=3){ for (int i=0;i<=n;i++){ res+=i; } return res; } res=6; int i=3; 阅读全文
posted @ 2021-05-24 10:02
菜鸟哟
阅读(59)
评论(0)
推荐(0)
摘要:
//一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。分析:最后一次跳1有f(n-1)跳法,最后一跳2有f(n-2)跳法,f(n)=f(n-1)+f(n-2)public class test { public static void main(String[ 阅读全文
posted @ 2021-05-24 09:51
菜鸟哟
阅读(108)
评论(0)
推荐(0)
摘要:
public static void quick_sort(int low,int high,int[]arry){ int i,j,jizhun,temp; if (low>high){ return; } i = low; j = high; jizhun = arry[low]; while 阅读全文
posted @ 2021-05-24 07:22
菜鸟哟
阅读(42)
评论(0)
推荐(0)
摘要:
####用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 ####pop返回栈顶元素 empty判断栈是否为空 import java.util.Stack; public class Solution { Stack<Integer> stack1 = new 阅读全文
posted @ 2021-05-24 07:11
菜鸟哟
阅读(42)
评论(0)
推荐(0)
摘要:
####大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0,第1项是1)。 n≤39n≤39 public class Solution { public int Fibonacci(int n) { if(n==0){ return 0; }else 阅读全文
posted @ 2021-05-24 07:03
菜鸟哟
阅读(46)
评论(0)
推荐(0)
摘要:
###把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素。NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。 import java.util.ArrayList;public class Solution { pu 阅读全文
posted @ 2021-05-24 06:59
菜鸟哟
阅读(60)
评论(0)
推荐(0)

浙公网安备 33010602011771号