- 博客(11)
- 收藏
- 关注
原创 春招100天——第五天11.15
今日题目1、最长递增子序列方法:动态规划import java.util.*;public class Solution { /** * retrun the longest increasing subsequence * @param arr int整型一维数组 the array * @return int整型一维数组 */ public int[] LIS (int[] arr) { int[] d.
2020-11-23 20:37:27 86
原创 春招100天——第四天11.14
今日题目1、链表相加import java.util.*;/* * public class ListNode { * int val; * ListNode next = null; * } */public class Solution { /** * * @param head1 ListNode类 * @param head2 ListNode类 * @return ListNode类 */
2020-11-21 12:16:35 64
原创 HashMap的key避免是可变对象
使用HashMap,如果key是自定义的类,就必须重写hashcode()和equals()。1.hashcode()和equals()是在哪里被用到的?什么用的?HashMap是基于散列函数,以数组和链表的方式实现的。而对于每一个对象,通过其hashCode()方法可为其生成一个整形值(散列码),该整型值被处理后,将会作为数组下标,存放该对象所对应的Entry(存放该对象及其对应值)。equals()方法则是在HashMap中插入值或查询时会使用到。当HashMap中插入 值或查询值对应的散
2020-11-17 15:50:01 467
原创 春招100天——第三天11.13
1、链表每k组反转import java.util.*;/* * public class ListNode { * int val; * ListNode next = null; * } */public class Solution { /** * * @param head ListNode类 * @param k int整型 * @return ListNode类 */ public ...
2020-11-15 10:29:10 81
原创 春招100天——第二天11.12
今日题目1、寻找数组中第K大的数import java.util.*;public class Finder { public int findKth(int[] a, int n, int K) { // write code here quickSort(a,0,n-1,K); return a[K-1]; } public void quickSort(int[] arr,int start,int end,i
2020-11-14 16:53:32 55
原创 春招100天——第一天11.11
1、反转链表/*public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; }}*/public class Solution { public ListNode ReverseList(ListNode head) { ListNode pre=null; ListNode c..
2020-11-14 13:11:01 73
原创 代码在ieda启动后报错
在重新安装ieda后,打开原来的代码发现很多类报红,报红的地方是说这个调用的方法没有实现,仔细调用的方法是类似getter,setter相似的方法,但原来是类中没有使用getter和setter,原来是因为使用了lombok插件,简化的代码冗余度,不过这样的坏处是使得代码不易读了。...
2020-02-17 23:23:18 117
原创 【LeetCode-Java】Word Search
【题目】Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertic...
2018-10-31 21:15:20 150
转载 【LeetCode-面试算法经典-Java实现】【203-Remove Linked List Elements(删除单链表中的元素)】
原题 Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 -->...
2018-10-31 21:06:10 151
翻译 markdown编辑器使用
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表导出与导入导出导入欢迎使用Markdown编辑器你好...
2018-10-31 20:58:34 76
转载 php中 include,require,include_once,require_once 的区别
include(),require(),include_once(),require_once()作用都是包含并运行指定文件,但是使用场景又有很大区别。1.include()和require()的区别:include()引入文件时,如果遇到错误会提示错误并继续执行;require()引入文件遇到错误时也提示错误但会终止程序的运行。require()语句一般放在php脚本页面的最前面,php在执行前...
2018-04-20 12:00:50 103
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人