---恢复内容开始---Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lis...
分类:
其他好文 时间:
2014-08-31 17:01:51
阅读次数:
270
1 class Solution { 2 public: 3 double findMedianSortedArrays(int A[], int m, int B[], int n) { 4 vector v(m+n); 5 for(int i=0;i<m...
分类:
其他好文 时间:
2014-08-31 10:23:01
阅读次数:
176
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-08-30 02:21:18
阅读次数:
246
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:
其他好文 时间:
2014-08-30 01:10:48
阅读次数:
333
Hibernate三种状态的区分,以及save,update,saveOrUpdate,merge等的使用Hibernate的对象有3种状态,分别为:瞬时态(Transient)、 持久态(Persistent)、脱管态(Detached)。处于持久态的对象也称为PO(Persistence Obj...
分类:
系统相关 时间:
2014-08-29 21:23:08
阅读次数:
357
leetcode上有四道关于移除有序序列中重复数字的题目,其中两道为数组结构,两道为链表结构,分别为:
(1)Remove Duplicates from sorted array I:移除一个有序数组中的重复数字,并且返回新数组的大小。
(2)Remove Duplicates from sorted array II:移除一个有序数组中的重复数字,并且返回新数组的大小,和上道题目不同的是每...
分类:
其他好文 时间:
2014-08-29 18:24:28
阅读次数:
289
class Solution: # @param matrix, a list of lists of integers # RETURN NOTHING, MODIFY matrix IN PLACE. def setZeroes(self, matrix): di...
分类:
其他好文 时间:
2014-08-29 16:00:48
阅读次数:
203
题目:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
解析:合并k个有序链表,最后返回一个总的有序链表,分析并描述其复杂度。该题的实质为归并排序,平均时间复杂度为O(NlogN)。
...
分类:
其他好文 时间:
2014-08-29 11:05:07
阅读次数:
225
python列表排序简单记一下python中List的sort方法(或者sorted内建函数)的用法。关键字:python列表排序 python字典排序 sortedList的元素可以是各种东西,字符串,字典,自己定义的类等。sorted函数用法如下:Python代码sorted(data,cmp=...
分类:
编程语言 时间:
2014-08-29 10:37:57
阅读次数:
240