2016年1月18日

摘要: public ListNode reverseBetween(ListNode head, int m, int n) { if(head==null) return head; ListNode slow = head; ListNode f... 阅读全文
posted @ 2016-01-18 14:46 marc_java 阅读(1450) 评论(0) 推荐(0)
 
摘要: https://leetcode.com/problems/search-a-2d-matrix-ii/巧解题,矩阵本身等于了一个binary search tree,从中值开始走时间复杂度 O(m+n)public boolean searchMatrix(int[][] matrix, int ... 阅读全文
posted @ 2016-01-18 14:05 marc_java 阅读(281) 评论(0) 推荐(0)
 
摘要: 遍历,一共有三种情况,1. pre tail 或者 xcurrent.val && (last.val<x || x<=current.val)) { insertbtw(last,current,x); ... 阅读全文
posted @ 2016-01-18 13:09 marc_java 阅读(416) 评论(0) 推荐(0)