![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法导论实验分析总结
JennyReborn
stay hungry , stay foolish .
展开
-
快速排序(非递归方式实现)实验总结
今天写完了做完了快速排序的实验,每组实验数据集有999999个,实验结果如下: 优化方法 随机数组 升序数组 重复数组 原始算法 77ms 164137ms 44488ms 随机枢轴 123ms 64ms 42905ms 三数取中 84ms 19ms 42807ms 三数取中+直排 93ms 15ms 43858ms原创 2017-03-02 20:05:06 · 1114 阅读 · 0 评论 -
强连通分量的tarjan算法
一、数据集形式 其中:1595446(节点个数) 0(起始边) 1(终边)二、数据集数据集下载三、实现代码// Tarjan.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "time.h"#include <fstream>#include<iostream>原创 2017-05-09 19:25:02 · 333 阅读 · 0 评论 -
最小生成树的Kruskal算法
一、数据集形式 其中:6105(节点个数) 7035(边数) 0(id) 1609(起始边) 1622(终边) 57.403187(权重)二、数据集上传中等待审核成功再链接过来三、实现代码// Kruskal.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "tim原创 2017-05-09 19:10:29 · 239 阅读 · 0 评论 -
最小生成树的Prim算法实现
一、数据集形式 其中:6105(节点个数) 7035(边数) 0(id) 1609(起始边) 1622(终边) 57.403187(权重)二、数据集上传中等待审核成功再链接过来三、实现代码// Kruskal.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "tim原创 2017-05-09 19:08:59 · 347 阅读 · 0 评论 -
所有节点最短路径的Johnson实现
一、数据集形式 其中:6105(节点个数) 7035(边数) 0(id) 1609(起始边) 1622(终边) 57.403187(权重)二、数据集上传中等待审核成功再链接过来三、实现代码// Dijkstra.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "ti原创 2017-05-09 19:03:48 · 326 阅读 · 0 评论 -
单源点最短路径Bellman算法实现
一、数据集形式 其中:6105(节点个数) 7035(边数) 0(id) 1609(起始边) 1622(终边) 57.403187(权重)二、数据集上传中等待审核成功再链接过来三、实现代码#include "stdafx.h"#include "time.h"#include <fstream>#include<iostream>#include <stack>#include <q原创 2017-05-09 19:00:39 · 245 阅读 · 0 评论 -
单源点最短路径Dijkstra方法实现
一、数据集形式 其中:6105(节点个数) 7035(边数) 0(id) 1609(起始边) 1622(终边) 57.403187(权重)二、数据集数据集下载链接三、实现代码// Dijkstra.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "time.h"#原创 2017-05-09 18:58:10 · 365 阅读 · 0 评论 -
强连通分量的Garbow算法
一、数据集形式 其中:1595446(节点个数) 0(起始边) 1(终边)二、数据集上传中等待审核成功再链接过来三、实现代码// Tarjan.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "time.h"#include <fstream>#include<原创 2017-05-09 19:22:34 · 591 阅读 · 0 评论 -
快速排序的递归方法总结
原始算法MethodA.cpp#include "stdafx.h"#include "MethodA.h"MethodA::MethodA(int* ve){ A = ve;}MethodA::~MethodA(){}int* MethodA::QuickSort( int p, int r){ if (p < r) { int q = Pa原创 2017-03-02 20:34:09 · 329 阅读 · 0 评论 -
强连通分量的Kasaraju算法的实现
一、数据集形式 其中:1595446(节点个数) 0(起始边) 1(终边)二、数据集上传中等待审核成功再链接过来三、实现代码Base.h#pragma once#include "Tree.h"class CBase{public: CBase(CTree *t, int l); ~CBase(); int length; CTree* tree;};B原创 2017-05-09 19:33:22 · 849 阅读 · 0 评论