C++
No One
这个作者很懒,什么都没留下…
展开
-
插入排序 和 归并排序的c++实现
#include <iostream>using namespace std;#define MAX 10000int l[100], k[100];int main(){ void insertionSort(int *, int); void mergeSort(int *, int, int); int a[10] = {34, 56, 74, 34, 56, 12,原创 2016-09-14 13:25:10 · 457 阅读 · 0 评论 -
分支定界算法求解带有约束条件的最短路径问题
知识点:分支定界; Dijkstra; c++读取txt文件到二维数组这个题目是北航研究生算法课的,因为以前主要写java,用c++写作业的时候遇到了一些读文件啊,深度优先遍历图的问题啥的,所以记录下来。题目: Assignment 2 用分支定界算法求以下问题: 某公司于乙城市的销售点急需一批成品, 该公司成品生产基地在甲城市。甲城市与乙城市之间共有 n 座城市,互相以公路连通。甲城市、乙城原创 2016-12-21 17:04:19 · 6829 阅读 · 0 评论 -
Dijkstra求最短路径
把m1.txt与可执行文件放在统一路径下m1.txt(距离矩阵,9行9列)的数据如下:9999 6 3 1 9999 9999 9999 9999 9999 9999 9999 9999 9999 1 9999 9999 9999 9999 9999 2 9999 2 9999原创 2016-12-19 13:21:44 · 1051 阅读 · 0 评论 -
C++把txt文件读到二维数组
有一部分参考了这篇文章:http://lzh0859.blog.sohu.com/43892352.html,就是判断文件结束有问题查阅教材进行了调整,感谢两个函数,一个已知文件的行和列,一个位置,看函数名就清楚了#include <iostream>#include <fstream>using namespace std;#define MAX_NODE 100int n1, n2; // 分原创 2016-12-19 12:32:29 · 7575 阅读 · 1 评论 -
c++ 快速排序
直接上代码/************************** * File Name: quick-sort-p96.cpp * Author: No One * E-mail: [email protected] * Created Time: 2017-02-21 22:40:40**************************/#include <iostrea原创 2017-02-21 23:08:20 · 357 阅读 · 0 评论 -
ubuntu c++ 遍历文件
编译命令:g++ getSubFiles.cpp -std=c++11/************************** * File Name: getSubFiles.cpp * Author: No One * E-mail: [email protected] * Created Time: 2017-03-09 14:02:15*****************原创 2017-03-09 15:00:32 · 2418 阅读 · 0 评论 -
c++ 字符串分割函数
//字符串分割函数 vector split(string str, const string pattern) { string::size_type pos; vector result; str += pattern;//扩展字符串以方便操作 int size = str.size();for (int i = 0; i<size; i++){转载 2017-05-01 08:11:06 · 486 阅读 · 0 评论 -
完美的代价
// SmallHuiWen.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>#include <string>using namespace std;void solve(string str) { ...原创 2018-04-24 20:38:34 · 538 阅读 · 0 评论 -
TensorRT(C++)优化GoogleNet.caffemodel用于图像分类
TensorRT(C++版本)优化GoogleNet.caffemodel用于图像分类最近做一些模型优化的工作,主要用到Nvidia的TensorRT(https://developer.nvidia.com/tensorrt)对训练好的模型进行优化,以加快inference时间,下面是在sampleMNIST示例上进行修改后的代码,使用opencv读取彩色图片,输出预测结果并记录各个步骤的耗...原创 2018-06-01 11:45:59 · 48 阅读 · 1 评论