摘要:
在macOS High Sierra Version 10.13.6下使用Intellij在Java 8上执行Java程序,console中会打印如下警告信息: objc[31336]: Class JavaLaunchHelper is implemented in both /Library/J 阅读全文
摘要:
众所周知,Java语言提供了自动垃圾回收机制,使得程序员不用考虑自己释放不再使用的内存。既然回收内存的活都让Java自己干了,程序员在这方面能干的事情就不多了。尽管如此,Java也提供了一些让程序员对自动内存回收施加影响的方式。finalize()和PhantomReference就是其中两种,它们 阅读全文
摘要:
问题: https://leetcode.com/problems/add-two-numbers-ii/#/description 思路:该题与“415. Add Strings”类似,都需要先将原来的数字序列翻转,然后就转化成了跟“2. Add Two Numbers”类似的问题,进而就容易解决 阅读全文
摘要:
问题: https://leetcode.com/problems/01-matrix/#/description 基本思路:广度优先遍历,根据所有最短距离为N的格找到所有距离为N+1的格,直到所有的格都找到了最短距离。 具体步骤: 首先初始化矩阵,值为0的格其最短距离也是0,保持不变;值为1的格是 阅读全文
摘要:
Problem:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k... 阅读全文
摘要:
问题:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your ... 阅读全文
摘要:
1 public class Solution { 2 public ListNode mergeTwoLists(ListNode l1, ListNode l2) { 3 ListNode dummy1 = new ListNode(0), dummy2 = new L... 阅读全文
摘要:
问题:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lon... 阅读全文
摘要:
问题:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telep... 阅读全文
摘要:
问题:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in th... 阅读全文