前期基本数据准备 数据库表可参考mybatisPlus官网快速开始的表(简单测试一下) POJO @Data @AllArgsConstructor @NoArgsConstructor public class User { //对应数据库中的主键(uuid,自增id,雪花算法,redis,zoo ...
分类:
其他好文 时间:
2021-04-08 13:01:23
阅读次数:
0
二叉树——102. 二叉树的层序遍历 题目: 思路: 就是层序遍历,一层层扫下去,然后通过队列去实现,一个队列先暂存这一层的所有结点,然后另一个队列通过push_back的方式,实现从左到右的访问。 代码: class Solution { public: vector<vector<int>> l ...
分类:
其他好文 时间:
2021-04-08 12:59:26
阅读次数:
0
public static Object copyOf(Object a,int newLength){ Class cl = a.getClass(); if(!cl.isArray()){ return null; } Class componentType = cl.getComponentT ...
分类:
编程语言 时间:
2021-04-08 12:57:40
阅读次数:
0
比较for和while 代码比较复制代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class HelloWorld { public static void main(String[] args) { //使用while打印0到4 int i = ...
分类:
其他好文 时间:
2021-04-08 12:54:22
阅读次数:
0
1:公平锁和非公平锁 1.1 流程图 1.2 源码分析 ? 锁使用 final Lock lock = new ReentrantLock(); new Thread(()->{ lock.lock(); try { System.out.println(" "); Thread.sleep(100 ...
分类:
其他好文 时间:
2021-04-07 11:23:49
阅读次数:
0
static void Main(string[] args) { GetMd5(); } public static void GetMd5() { string str = "123"; //创建md5对象,是静态方法。不能new MD5 mymd5 = MD5.Create(); //comp ...
分类:
编程语言 时间:
2021-04-07 11:23:31
阅读次数:
0
下面这个例子和上面一样,除了说是子线程要join主线程。本例中还教会了大家,如何从主线程传参数到子线程。 例:1.5.3_2 class ThreadMark_to_win extends Thread { Thread mainT; Test t; public void run() { try ...
分类:
编程语言 时间:
2021-04-07 11:19:09
阅读次数:
0
题目:给你一个整数数组 arr ,数组中的每个整数 互不相同 。另有一个由整数数组构成的数组 pieces,其中的整数也 互不相同 。请你以 任意顺序 连接 pieces 中的数组以形成 arr 。但是,不允许 对每个数组 pieces[i] 中的整数重新排序。如果可以连接 pieces 中的数组形 ...
分类:
编程语言 时间:
2021-04-07 11:16:25
阅读次数:
0
package com.easyagu.liwei.list;import redis.clients.jedis.Jedis;/** * 秒杀案例 */public class SeckillDemo { public static void main(String[] args) { Secki ...
分类:
其他好文 时间:
2021-04-07 11:07:01
阅读次数:
0
题解 直接遍历一遍数组,如果遇到重复的数字直接返回就可以了,如果不存在返回-1,只需要在遍历的过程中使用一个集合存储我们遇到过的数字,方便后续判定 代码如下 class Solution { public int findRepeatNumber(int[] nums) { Set<Integer> ...
分类:
编程语言 时间:
2021-04-07 11:02:18
阅读次数:
0