一. 算法描述 自顶向下的归并排序:采用分治法进行自顶向下的程序设计方式,分治法的核心思想就是分解、求解、合并。先将长度为N的无序序列分割平均分割为两段然后分别对前半段进行归并排序、后半段进行归并排序最后再将排序好的前半段和后半段归并 过程(2)中进行递归求解,最终下图详细的分解了自顶向下的合并.....
分类:
其他好文 时间:
2014-06-19 06:34:51
阅读次数:
126
MD5简介: MD5的全称是Message-Digest Algorithm 5,在90年代初由MIT的计算机科学实验室和RSA Data Security Inc发明,经MD2、MD3和MD4发展而来。MD5将任意长度的“字节串”变换成一个128bit的大整数,并且它是一个不可逆的字符串变换算法。...
分类:
其他好文 时间:
2014-06-18 18:43:20
阅读次数:
272
Billy investigates the question of applying greedy algorithm to different spheres of life. At the moment he is studying the application of greedy algo...
分类:
其他好文 时间:
2014-06-18 15:17:54
阅读次数:
272
windows 环境如何恢复 (oracle 11g grid) ocr voting 损坏的集群
oracle 11g 以后 ocr 可以放到 asm 磁盘上,而ASM的启动依赖于ocr和votedisk,所以在丢失ocr或votedisk 会导致cluter无法正常启动
如果原来的ocr 位置已经不存在,则必须使用相同的名字在原来相同的位置创建一个空 OCR 。...
分类:
数据库 时间:
2014-06-18 12:42:06
阅读次数:
241
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
思路:最简单的方法就是按...
分类:
其他好文 时间:
2014-06-18 12:40:54
阅读次数:
265
题目
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only const...
分类:
其他好文 时间:
2014-06-18 11:53:39
阅读次数:
138
上网查了资料,看了其他人写的代码,学到了一下一些:c++头文件:algorithm.h这个头文件可以对范围内的数据做任何处理#include里面包含的函数有: 非修改性序列操作(12个)循环对序列中的每个元素执行某操作for_each()查找在序列中找出某个值的第一次出现的位置find()在序列中找...
分类:
其他好文 时间:
2014-06-17 15:30:42
阅读次数:
204
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet...
分类:
其他好文 时间:
2014-06-17 14:57:30
阅读次数:
269
一. 算法描述 快速排序:快速排序采用分治法进行排序,首先是分割,选取数组中的任意一个元素value(默认选用第一个),将数组划分为两段,前一段小于value,后一段大于value;然后再分别对前半段和后半段进行递归快速排序。其实现细节如下图所示:二. 算法实现/*================....
分类:
其他好文 时间:
2014-06-17 13:15:16
阅读次数:
211
概述(泛型算法)
大多数算法都定义在头文件algorithm中。标准库还在头文件numeric中定义了一组泛型算法。
#include
#include
#include
#include
using namespace std;
int main()
{
vector vec;
for(size_t t=0 ; t != 44 ; ++t)
{
...
分类:
编程语言 时间:
2014-06-16 21:47:20
阅读次数:
300