
离散数学
庚_
入门学习中,可以但是要给钱。
展开
-
【离散数学】编程判断二部图
#include<iostream> const int N = 50; using namespace std; void creat_matrix(int a[N][N], int n) { for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> a[i][j]; } bool color_matrix( int color[N],int a[N][N],int n) { for (i原创 2022-03-25 09:18:34 · 387 阅读 · 0 评论 -
【离散数学】编程实现最小生成树Kruskal
#include<iostream> #include<vector> #include<algorithm> using namespace std; void showtree(int* tree, int n) { cout << "最小生成树为:{"; for (int i = 0; i < n; i += 2) { cout << "(" << tree[i] << "," << t原创 2022-03-25 09:18:18 · 447 阅读 · 0 评论 -
【离散数学】编程实现矩阵乘法和可达矩阵
#include<iostream> #define N 4 #define MATRIX_SIZE 4 using namespace std; void show(int a[MATRIX_SIZE][MATRIX_SIZE]) { for (int i = 0; i < MATRIX_SIZE; i++) { for (int j = 0; j < MATRIX_SIZE; j++) { cout << a[i][j] << " ";原创 2022-03-25 09:13:20 · 1045 阅读 · 0 评论 -
【离散数学】编程实现加权哈夫曼树和
#include<iostream> #include<algorithm> #define N 100 using namespace std; int math=0; typedef struct LNode { int data; LNode* next; }LNode, * LinkList; LinkList InitList(LinkList& L, int n, int* a) { int x; int i = 0; L = (LinkList)mal原创 2022-03-25 09:13:02 · 143 阅读 · 0 评论 -
【离散数学】最小生成树失败普罗米
#include<iostream> #include<vector> using namespace std; void showtree(int tree[], int n) { cout << "最小生成树为:{"; for (int i = 0; i < n; i += 2) { cout << "(" << tree[i] << "," << tree[i + 1] << ")";原创 2022-03-25 09:07:23 · 148 阅读 · 0 评论 -
【离散数学】实现哈夫曼树
#include<iostream> #include<algorithm> #define N 100 using namespace std; typedef struct LNode { int data; LNode* next; }LNode, * LinkList; LinkList InitList(LinkList& L, int n,int *a) { int x; int i = 0; L = (LinkList)malloc(sizeof(LN原创 2022-03-25 09:12:40 · 369 阅读 · 0 评论