工程实践

VisualStudio2022+Opencv配置

下载OpenCV OpenCV官网下载下来的是一个exe可执行文件,运行后是一个解压程序,解压路径设置为找得到的就可以了。添加系统路径 VisualStudio安装 选择使用C++的桌面开发就可以了。 运行VisualStudio 创建新项目 配置OpenCV 找到之前解压的目录

2023-02-07· 1 min · 46 字
算法与最优化

链栈

通过链表实现栈 #include #include “chainList.cpp” using namespace std; template class linkedStack { public:

2022-06-11· 2 min · 241 字
算法与最优化

构建数组栈类

构建数组栈类 代码 #include using namespace std; // 改变一个一维数组的长度 template void changeLength1D(T *&a, int oldLength

2022-06-05· 2 min · 363 字
算法与最优化

对角矩阵类

对角矩阵类(部分方法C++) 代码 #include using namespace std; template class diagonalMatrix { public: explicit diagonalMatr

2022-06-05· 2 min · 338 字
算法与最优化

创建矩阵类(C++)

#include using namespace std; template class matrix { public: matrix(int theRows = 0, int theColumns = 0); ma

2022-06-03· 5 min · 976 字
算法与最优化

创建和使用不规则二维数组

#include using namespace std; int main() { int numberOfRows = 5; // 定义每一行的长度 int length[5] = {6, 3, 4, 2, 7}; // 声明一个二维数组变量

2022-06-02· 1 min · 84 字
算法与最优化

并查集解决在线等价类问题

#include using namespace std; // 使用数组实现的并查集算法 int *equivClass;// 等价类数组 int n;//元素个数 void initialize(int numberOfElements) {

2022-06-02· 1 min · 212 字
算法与最优化

箱排序

箱排序 假定用一个链表保存一个班级学生清单。结点的数据有:学生姓名和考试分数。假设分数是0~100的整数。 采用箱排序可以把分数相同的结点放在同一个箱子里,然后把箱子连接起来就得到了有序的链表 链表定义 #include #include <

2022-06-01· 8 min · 1644 字
算法与最优化

单向链表实现

#include #include using namespace std; class illegalParameterValue { public: illegalParameterValue() : messa

2022-05-28· 4 min · 650 字
算法与最优化

二叉树的遍历

二叉树的遍历 本题要求给定二叉树的4种遍历 函数接口定义 void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT

2022-04-20· 2 min · 343 字
算法与最优化

快速排序(C语言实现)

#include<stdio.h> void Swap(int *x, int *y) { int t; t = *x; *x = *y; *y = t; } int Partition(int A[], int p, int r) { int X = A[p]; /

2022-04-18· 1 min · 152 字
算法与最优化

逆转链表

单链表逆转 本题要求实现一个函数,将给定的单链表逆转 函数接口定义 List Reverse(List L); 其中List结构定义如下: typedef struct Node PtrToNode; struct Node{ ElementType Data; / 存储结点

2022-04-15· 1 min · 133 字