上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页

2022年7月22日

只出现一次的数字

摘要: 介绍:给出一个数组,找到这个数组中只出现了一次的"数字" *这个效率有点差,因为运用了好多循环(不推荐) 执行用时:1367 ms 内存消耗:42.5 MB public class SingleNumber { public static void main(String[] args) { in 阅读全文

posted @ 2022-07-22 17:53 陈嘻嘻- 阅读(33) 评论(0) 推荐(0) 编辑

合并两个有序数组

摘要: 介绍:给出对应‘数组’和对应的‘m,n’ 来选择要合并的区间 /* 注意: 我这个和leetCode有点不一样,leetCode要求在nums1这个集合中 只要把最后的集合到数组的便利,改成 nums1[i] = list.get(i);就可以,但是我是新建一个数组。 */ public class 阅读全文

posted @ 2022-07-22 15:28 陈嘻嘻- 阅读(49) 评论(0) 推荐(0) 编辑

2022年7月21日

搜索插入位置

摘要: 介绍:搜索插入位置,如果有就返回索引,如果没有就返回他应该插入那个索引位置 package cut; public class SearchInsert { public static void main(String[] args) { int[] ints = {1, 3, 5, 6}; Sol 阅读全文

posted @ 2022-07-21 16:22 陈嘻嘻- 阅读(62) 评论(0) 推荐(0) 编辑

移除元素

摘要: 介绍:移除数组中指定元素,返回集合剩下元素的个数 public class Bracket { public static void main(String[] args) { int[] ints = {3, 2, 2, 3}; Solution3 solution3 = new Solution 阅读全文

posted @ 2022-07-21 15:07 陈嘻嘻- 阅读(15) 评论(0) 推荐(0) 编辑

去除"数组"中重复的数据

摘要: 去重:去除数据中重复的数据 public class Map_offRepetition { public static void main(String[] args) { Integer[] nums = new Integer[]{1, 1, 1, 1, 2, 1, 2, 3, 3, 3, 5 阅读全文

posted @ 2022-07-21 14:18 陈嘻嘻- 阅读(40) 评论(0) 推荐(0) 编辑

最长的公共前缀

摘要: 题目:最长的公共前缀 /** * 类型 > 最长的公共前缀 * * 我的思路: 木桶效应,找到最短的那个元素,然后进行对比 */ public class LongestCommonPrefix { public static void main(String[] args) { Solution2 阅读全文

posted @ 2022-07-21 10:14 陈嘻嘻- 阅读(30) 评论(0) 推荐(0) 编辑

2022年7月20日

移动零

摘要: /* leetCode -- 移动零 */ public class Remove_zero { public static void main(String[] args) { Solution solution = new Solution(); int[] number = new int[] 阅读全文

posted @ 2022-07-20 11:51 陈嘻嘻- 阅读(67) 评论(0) 推荐(0) 编辑

2022年7月19日

回文数

摘要: 回文数,将数字反转在对比,是否相同 public class palindromicNumber { public static void main(String[] args) { Palindromic palindromic = new Palindromic(); palindromic.t 阅读全文

posted @ 2022-07-19 10:38 陈嘻嘻- 阅读(55) 评论(0) 推荐(0) 编辑

2022年7月17日

Mysql命令:

摘要: Mysql命令: 解析:select 你要显示出来的字段信息 from 你要查的表名 where 限定条件 1- 二级排序用的是order by 而不是 where 二级排序的例子,id降序,money升序: select 你要显示出来的字段信息 from 你要查的表名 order by id DE 阅读全文

posted @ 2022-07-17 00:59 陈嘻嘻- 阅读(15) 评论(0) 推荐(0) 编辑

2022年7月14日

变量的赋值

摘要: 1-概念: /** * 这里我们学习,变量的赋值 * 1-基本数据类型 : byte、char、short、int、long、float、double --独立个体 * 2-引用数据类型 :new出来的 --连体婴儿 */ 2-代码块: public class Test01 { public st 阅读全文

posted @ 2022-07-14 15:10 陈嘻嘻- 阅读(133) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页

导航