算法与最优化

箱排序

箱排序 假定用一个链表保存一个班级学生清单。结点的数据有:学生姓名和考试分数。假设分数是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 字
算法与最优化

利用vector实现的基于数组的线性表

#include #include #include using namespace std; class illegalParameterValue { public: illegalPa

2022-05-28· 2 min · 343 字
算法与最优化

动态数组(C++)

#include #include #include #include using namespace std; // 重写copy代码 templa

2022-05-26· 3 min · 627 字
算法与最优化

一元多项式的乘法与加法运算

一元多项式的乘法与加法运算 设计函数分别求两个一元多项式的乘积与和 输入格式 输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。 输出格式 输出分2行,分别以指数递降方式输出乘积多项式

2022-05-18· 4 min · 800 字
深度学习

猫狗数据集分类VGG16(TensorFlow实现)

import random import os import tensorflow as tf from tensorflow import keras from shutil import copyfile from tensorflow.keras import layers

2022-05-18· 5 min · 857 字
深度学习

猫狗数据集分类VGG16(PyTorch实现)

数据集地址:https://www.kaggle.com/datasets/shaunthesheep/microsoft-catsvsdogs-dataset from shutil import copyfile import random import

2022-05-18· 4 min · 759 字
算法与最优化

二叉搜索树的操作集

二叉搜索树的操作集 本题要求实现给定二叉搜索树的5种常用操作 函数接口定义 BinTree Insert( BinTree BST, ElementType X ); BinTree Delete( BinTree BST, ElementType X ); Position F

2022-04-22· 3 min · 538 字
编程题解

先序输出叶结点

先序输出叶结点 本题要求按照先序遍历顺序输出给定二叉树的叶节点 函数接口定义 void PreorderPrintLeaves( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Posi

2022-04-22· 1 min · 115 字
编程题解

求二叉树高度

求二叉树高度 本题要求给定二叉树的高度 函数接口定义 int GetHeight( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TN

2022-04-22· 1 min · 133 字
算法与最优化

二分查找

二分查找 本题要求实现二分查找算法。 函数接口定义 Position BinarySearch( List L, ElementType X ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; st

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

二叉树的遍历

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

2022-04-20· 2 min · 343 字