随笔分类 - 算法设计与分析
摘要:package com.jn.rz.实验三; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * @author 江南大学1033190417 * @date 2022/5/5 10:4
阅读全文
摘要:#if 0#include<iostream>#include<queue>#include<vector>using namespace std; class Travling { friend void TSP(int**, int);private: int n; int** dis; int
阅读全文
摘要:#if 1#include<iostream>#include<queue>#include<vector>using namespace std; class Travling { friend void TSP(int**,int);private: int n;//点个数 int** dis;
阅读全文
摘要:#if 1#include<iostream>using namespace std; class Color { friend int mColoring(int, int, int**);private: bool Ok(int k);//检查颜色可用性 void Backtrack(int t
阅读全文
摘要:#include<iostream>#include<algorithm>using namespace std;#define MAX 999; class Flowshop { friend int Flow(int** M, int n, int* bestx);private: void B
阅读全文
摘要:#if 0#include<iostream>using namespace std;struct EdgeType //关于图中边的信息的结构体{ int from, to; int Weight;};struct EdgeGraph //关于整个图中顶点、边的所有信息,需要将前面边的结构体内容导
阅读全文
摘要:#if 0#include<iostream>using namespace std;#define maxint 999 template<class Type> void Prim(int n, Type ** c) {//c[i][j]表示边(i,j)的权值,n是顶点个数 Type *lowc
阅读全文
摘要:#if 1#include<iostream>#include<algorithm>using namespace std;template<class Typew,class Typep>class Knap { friend Typep Knapsack(Typep*, Typew*, Type
阅读全文
摘要:#include<iostream>#include<cmath>using namespace std; class Queen { friend int nQueen(int);private: bool Place(int k); void Backtrack(int t); int n,//
阅读全文
摘要:#include<iostream>using namespace std; class Loading { friend int MaxLoading(int* w, int c, int n, int* bestx);private: void Backtrack(int i); int n;/
阅读全文
摘要:【问题描述】使用动态规划算法解凸多边形最优三角剖分问题,具体来说就是,依据递归式,按照顺序求得子问题,使得该三角剖分中诸三角形上权之和为最小。 【输入形式】在屏幕上输入凸多边形顶点个数和顶点坐标。 【输出形式】最优三角剖分后的三角形顶点。 【样例1输入】 7 8 26 0 20 0 10 10 0
阅读全文