题目:
Given a sorted linked list, delete all duplicates such that each element appear only once.
这道链表的题也比较简单,目标是为了去重,只是需要注意在去重的过程中需要使用while循环,使一个节点的下一个节点必须指向与其不同的节点
上代码咯
# Definition for singly-li...
分类:
其他好文 时间:
2014-09-25 18:39:57
阅读次数:
193
mysqlPartition(分区)初探表数据量大的时候一般都考虑水平拆分,即所谓的sharding.不过mysql本身具有分区功能,可以实现一定程度 的水平切分.mysql是具有MERGE这种引擎的,就是把一些结构相同的MyIASM表作为一个表使用,但是我觉得 MERGE不如partition实用...
分类:
数据库 时间:
2014-09-25 13:50:08
阅读次数:
248
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 lists. 1 /** 2 ...
分类:
其他好文 时间:
2014-09-25 13:02:08
阅读次数:
204
#-*- encoding=utf-8 -*- import operator #按字典值排序(默认为升序) x = {1:2, 3:4, 4:3, 2:1, 0:0} sorted_x = sorted(x.iteritems(), key=operator.itemgetter(1)) print sorted_x #[(0, 0), (2, 1), (1, ...
分类:
编程语言 时间:
2014-09-25 00:33:38
阅读次数:
290
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-09-24 17:45:07
阅读次数:
214
1.冒泡排序//基本算法for(i=1;i1){ mergeSort(list[0~list.length/2]); mergeSort(list[list.length/2+1~list.length-1]); merge list...
分类:
其他好文 时间:
2014-09-24 16:49:07
阅读次数:
175
1,代码如下:<?php functionfillRandomString(){ //生成验证码 $char=array_merge(range(0,9),range("a","z"),range("A","Z")); //讲字符串$char打乱 $luan=str_shuffle(implode("",$char)); //从字符串中随机取四位 returnsubstr($luan,0,4); } //创建画布 header..
分类:
Web程序 时间:
2014-09-24 16:34:59
阅读次数:
199
原文地址:http://www.vogella.com/tutorials/AndroidListView/article.html1.Android and Lists1.1.Using lists in AndroidThe display of elements in a list is a ...
分类:
移动开发 时间:
2014-09-24 13:11:36
阅读次数:
262
原文:http://blog.sina.com.cn/s/blog_62f987620100sf13.html单独将标签做个介绍,是因为它在优化UI结构时起到很重要的作用。目的是通过删减多余或者额外的层级,从而优化整个Android Layout的结构。核心功能就是减少冗余的层次从而达到优化UI的目...
分类:
移动开发 时间:
2014-09-24 11:00:16
阅读次数:
229
1.归并排序的思想
2.归并排序的具体实现
3.归并排序的改进:
(1)当递归到一定程度,数组已经足够小时(length
(2)当较小的那部分数值的最大值>=较大部分的最小值时,则直接返回,不对这两部分数组进行合并。
4.归并排序的变形—buttom up merge sort
基本思路:
(1)设length=2。依次遍历数组...
分类:
其他好文 时间:
2014-09-23 16:32:54
阅读次数:
149