![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法基础
NoBugPro
这个作者很懒,什么都没留下…
展开
-
LeetCode两数之和
class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { if(l1==null){ l1=new ListNode(0); } if(l2==null){ l2=new ListNode(0); ...原创 2019-03-12 13:59:21 · 423 阅读 · 1 评论 -
寻找两个有序数组的中位数
class Solution { public double findMedianSortedArrays(int[] nums1, int[] nums2) { int i=0,j=0; List<Integer> list = new ArrayList<>(); while(i<nums1.length||j<...原创 2019-03-12 14:39:54 · 211 阅读 · 0 评论 -
leetcode反转链表
1.递归法 public ListNode reverseList(ListNode head) { if(head==null||head.next==null) return head; ListNode p = reverseList(head.next); head.next.next=head; head.next=...原创 2019-03-13 12:10:39 · 227 阅读 · 0 评论