题目链接 https://icpcarchive.ecs.baylor.edu/external/65/6514.pdf题意:给出n个数(n a[max(i,j)]) swap(a[i], a[j]) ;}//Carlos's Codewhile (!sorted(a)) { int i...
分类:
其他好文 时间:
2014-09-25 21:45:07
阅读次数:
244
题目:
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in t...
分类:
其他好文 时间:
2014-09-25 21:12:57
阅读次数:
148
题目:
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
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
Search in Rotated Sorted Array ISuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2...
分类:
其他好文 时间:
2014-09-22 23:54:43
阅读次数:
271
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:
其他好文 时间:
2014-09-22 22:48:33
阅读次数:
180
当索引出现问题时,会导致严重的性能问题,索引问题包括索引不可用、索引碎片导致性能下降,我们需要一些手段在检测索引的问题,并解决这些问题。这一篇将为你讲述怎么定位索引问题,并提供了解决的办法。
索引不可用
索引不可用的原因有很多,包括:
1)索引空间耗尽,导致SQL*Loader更新索引失败;
2)创建索引的过程中实例失败;
3)唯一键有重复值;
4)某个索引的顺序与sorted...
分类:
数据库 时间:
2014-09-22 15:19:33
阅读次数:
365
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:
其他好文 时间:
2014-09-21 19:36:11
阅读次数:
172