Mergeksorted linked lists and return it as one
sorted list. Analyze and describe its
complexity.思路:合并k个有序链表为一个有序链表。我们可以用先合并两个链表的方法,然后逐个遍历链表数组,与上一个合并结束...
分类:
其他好文 时间:
2014-05-12 15:07:06
阅读次数:
305
当类中用到一些固定值时,希望将其定义为const成员变量,防止被修改。但因为const成员变量因为初始化之后就不能修改,因此只能在构造函数的初始化列表中初始化如果是数组,则没有办法在初始化列表中初始化,必须定义为static,放在类外定义例子://const_array.h#include
usin...
分类:
其他好文 时间:
2014-05-12 12:16:52
阅读次数:
228
class Solution {public: ListNode
*insertionSortList(ListNode *head) { if (head == NULL) return NULL; ListNode*
sorted_head = head; ...
分类:
其他好文 时间:
2014-05-10 20:39:14
阅读次数:
419
获取插入的id:mysql_insert_idfetch_row转换成数组这个有0123下标的
fetxh_array转换不仅有数字下标还有字段名mysql_close($conn)关闭数据库连接
分类:
其他好文 时间:
2014-05-10 06:48:23
阅读次数:
230
javascript版in_array函数,用于判断数组中是否存在特定值。判断一个字符串或者数字是否在数组内,很多程序语言都有这样一样专门的函数,比如PHP的in_array()。那么JS有木有呢,很遗憾,JS木有这样的函数,于是想到伟大的JQ是否封装了这个函数,找到了API,JQ的确封装了这个函数...
分类:
编程语言 时间:
2014-05-10 06:10:51
阅读次数:
360
原题地址:http://www.cnblogs.com/x1957/p/3373994.html题意:Given
an array of integers, every element appearstwiceexcept for one. Find that single
one.要求:线性时间复...
分类:
编程语言 时间:
2014-05-10 05:22:27
阅读次数:
408
AJAX的知识: 1:mysql_fetch_row与mysql_fetch_array的区别
mysql_fetch_row:从结果集中取得一行作为关联数组(转换成0,1,2,3小标就是数组有下标)
mysql_fetch_array:从结果集中取得一行作为关联数组,或数字数组,或二者兼...
分类:
其他好文 时间:
2014-05-10 03:15:14
阅读次数:
299
Jump Game Given an array of non-negative
integers, you are initially positioned at the first index of the array. Each
element in the array represents ...
分类:
其他好文 时间:
2014-05-10 03:13:50
阅读次数:
481
原题地址:http://oj.leetcode.com/problems/single-number-ii/题意:Given
an array of integers, every element appearsthreetimes except for one. Find that
single ...
分类:
编程语言 时间:
2014-05-10 03:01:41
阅读次数:
413
There are two sorted arrays A and B of size m
and n respectively. Find the median of the two sorted arrays. The overall run
time complexity should be ...
分类:
其他好文 时间:
2014-05-09 23:26:18
阅读次数:
353