1、 递归算法:quicksort.cpp#include using namespace
std;void Swap(int a[],int i,int j){ int temp=a[i]; a[i] = a[j]; a[j] = temp;}int
Partition(int a[],int l...
分类:
其他好文 时间:
2014-05-27 02:29:55
阅读次数:
274
【面试题030】最小的k个数题目: 输入n个整数,找出其中最小的k个数。
例如输入4、5、1、6、2、7、3、8这8个字,则其中最小的4个数字是1、2、3、4。思路一:
可以同样的基于随机快速排序的Partition函数,来对数组做划分, 基于k来作调整,返回调用Partition函数,直到...
分类:
其他好文 时间:
2014-05-27 02:04:02
阅读次数:
287
Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the origi...
分类:
其他好文 时间:
2014-05-24 04:59:06
阅读次数:
275
乱搞分区磁盘什么的导致开机和这位仁兄一样:http://zhidao.baidu.com/question/495602654256708364.html?ssid=0&from=1001874a&uid=0&pu=usm%401%2Csz%401320_1002&bd_page_type=1&ba...
5道题目分别是:【Combinations】、【Search a 2D Matrix】、【Scramble String 】、【Rotate List 】、【Partition List】,由于有一些题目不需要发一整篇博文来记录,所以就将这些题目以一篇博文5道来记录。...
分类:
其他好文 时间:
2014-05-20 15:36:16
阅读次数:
293
代码SELECT A.*FROM( SELECT ROW_NUMBER()
OVER(PARTITION BY Host ORDER BY Host,count(EntranceURL) DESC) AS ROW, Host,
EntranceURL as PageURL ...
分类:
数据库 时间:
2014-05-19 09:12:59
阅读次数:
338
MBR主引导记录(PC)
MBR会告诉电脑从该设备的某一个分区(partition)来装载引导加载程序(boot loader)。 Bootloader Boot
loader储存有操作系统(OS)的相关信息,比如操作系统名称,操作系统内核 (kernel)所在位置等。常用的boot loader有...
分类:
系统相关 时间:
2014-05-18 20:13:06
阅读次数:
388
>__ 100010 #pragma once11 #endif // _MSC_VER
> 100012 13 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from
Windows headers14 15 16 ...
有向无环图(DAG,Directed Acyclic Graph)上的动态规划是学习动态规划的基础。很多问题都可以转化为DAG上的最长路、最短路或路径计数问题。
题目描述:
有n个矩形,每个矩形可以用两个整数a,b描述,表示它的长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a
分析:
矩形之间的"可嵌套"关系是一个典型的二元关...
分类:
其他好文 时间:
2014-05-18 07:20:52
阅读次数:
248
Given a linked list and a value x, partition it
such that all nodes less than x come before nodes greater than or equal to x.You
should preserve the o...
分类:
其他好文 时间:
2014-05-18 02:34:57
阅读次数:
352