自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 454. 四数相加 II

public int fourSumCount(int[] nums1, int[] nums2, int[] nums3, int[] nums4) { HashMap<Integer, Integer> map = new HashMap<>(); int res = 0; int temp; for (int i : nums1) { for (int j : nums2) { ...

2022-05-15 18:42:33 88

原创 438. 找到字符串中所有字母异位词

利用滑动窗口+哈希表进行实现 public List<Integer> findAnagrams(String s, String p) { ArrayList<Integer> list = new ArrayList<>(); int s_length = s.length(); int p_length = p.length(); int s_map[] = new int[26];

2022-05-14 21:52:08 80

原创 49题-字母异位词分组

给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。字母异位词 是由重新排列源单词的字母得到的一个新单词,所有源单词中的字母通常恰好只用一次。 public List<List<String>> groupAnagrams(String[] strs) { HashMap<String, List<String>> map = new HashMap<>(); for (S

2022-05-14 21:40:09 106

原创 冒泡+选择+插入排序

1.冒泡排序(优化前+优化后)//优化前 static void bubble(int a[]) { int temp; for (int i = 0; i < a.length - 1; i++) { for (int j = 0; j < a.length - 1 - i; j++) { //第一趟排序 if (a[j] >= a[j + 1]) {

2022-03-02 17:57:19 203

原创 希尔排序(2种方式)

public static void shellSort(int[] arr) { int temp = 0; int count = 0; for (int gap = arr.length / 2; gap > 0; gap /= 2) { for (int i = gap; i < arr.length; i++) { for (int j = i - gap; j &...

2022-03-02 17:39:45 102

原创 常见排序算法

1. 冒泡排序,平均时间算法复杂度O(n^2) static void bubble(int a[]) { int temp; boolean flag = false; for (int i = 0; i < a.length - 1; i++) { for (int j = 0; j < a.length - 1 - i; j++) { //第一趟排序 if (a[j] >=

2022-02-27 21:00:53 278

原创 迷宫求解(递归+回溯)

二维数组:map[8][7]构成围墙;数字1代表围墙或者障碍物;数字0代表空白处或者可通行处;从array[1][1]出发,到达array[6][5]即为达到出口;初始迷宫图形如下:实现代码如下:public class MiGong { public static void main(String[] args) { //创建一个二位数组 模拟迷宫 //地图 int[][] map = new int[8][7];

2022-02-27 20:53:12 182

原创 死亡八皇后求解(回溯+递归)

public class Queen8 { //定义一个max 有多少皇后 int max = 8; //定义数组array。保存保存八皇后放置的位置结果 //比如:arr={0,4,7,5,2,6,1,3} int[] array = new int[max]; static int count; static int judgeCount; public static void main(String[] args) { .

2022-02-27 20:40:41 587

原创 JDBC连接数数据库--“猪“ 获 “得“ “执行“的“释放“权

jdbc连接数据库四步操作

2021-11-30 17:29:32 508

原创 git push 出错

错误1 :errno:10054git config --global --unset http.prox错误2:time out:git config --global http.proxygit config --global --unset http.proxy

2021-11-27 21:19:16 289

原创 Java程序在计算机中的三个阶段以及类的加载过程

java程序在计算机的三个阶段类的加载过程

2021-11-19 15:37:18 260

原创 Java反射--getMethod()和getDeclaredMethod()方法的区别

getMethod()只可以访问共有方法 私有变量不能访问;getDeclaredMethod() 可以访问获取私有(暴力破解)和公有变量的方法。public class ReflectMethod { public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, Invo

2021-11-19 12:03:28 538

原创 TCP三次握手

(图片来源于韩顺平教学视频)

2021-11-09 17:31:37 377

原创 网络编程-socket.closed 异常

socket.closed异常,在使用BufferedInputStream/BufferedOutputStream 写入字节/字符内容时,记得flush,否则会出现异常。

2021-11-09 10:40:45 485

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除