- 博客(8)
- 收藏
- 关注
原创 用httplib.h完成一个两人玩的三子棋
void updateplay1(const httplib::Request ®, httplib::Response &res) //获取更新后的棋盘。void play1(const httplib::Request ®, httplib::Response &res) //获取初始化。cout << "----------输入你想移动的位置----------" << endl;cout << "重新下:" << endl;实现功能:客户端和服务端数据交互。
2023-09-19 17:25:10
156
原创 LRU算法
1.LRU最近最久未使用算法,如其名,将常使用的数据放在容易访问的地方,将不长使用的放在不容易访问的地方,或者压缩保存起来,要访问的时候再去解压缩2.代码的实现,容器选list和map;这里我自己实现的list,也只实现了其中的一小部分#include<iostream>#include<map>using namespace std;class listnode{public: friend class LRU; listnode():val(...
2022-03-13 17:48:11
412
原创 AVL树的代码(插入和删除算法)
#include<iostream>#include<vector>#include<stack>using namespace std;template<class type>class AVL;template<class type>class AVLnode{public: friend class AVL<int>;public: AVLnode(AVLnode<type>* L ...
2022-03-02 15:27:11
343
原创 实现BST
#include<iostream>#include<vector>using namespace std;template<class type>class BSTNode;template<class type>class BST1;template<class type>class BSTNode{public: friend class BST1<type>; BSTNode(typ...
2022-01-27 15:11:12
242
原创 模拟实现文本文档功能
#include<iostream>#include<fstream>#include<conio.h>#include<string>#include<array>using namespace std;static int num = 0;//记录的元素的个数void menu(){ cout << "0.退出" << endl; cout << "1.写文件"<<...
2022-01-07 20:10:20
467
原创 flying-egg 迷宫的实现
话不多说1.定义一个二维数组2.数组为0的时候为空,1的时候打印墙用户自己实现迷宫,自己放置墙和空的位置3.设置好之后,寻找路径,由于自己的思想比较笨,所以寻找的路径虽然是成功的,但是有点难以理解4.头文件#include<stdio.h>#include <windows.h>#include<conio.h>5.全局变量static int start_x = 0;//记录的是起点横坐标static int start_y =..
2021-12-26 13:25:19
3471
原创 地铁售票系统的模拟实现
int main(){ test t1; int past_s=0; string s1, s2; cout << "起点站:"; cin >> s1; cout << "终点站:"; cin >> s2; t1.find(s1,s2); t1.initstruct(); if (front_s == 0) { cout << "er...
2021-12-25 11:43:25
831
1
原创 双循环链表的实现
#include<stdio.h>#include<stdlib.h>#include<assert.h>#include"work123.h"#include"list.h"int main(int argc, char argv[]){ DCList mylist; LTDataType x; ListNode* phead = ListCreate( &mylist); LTDataType item = 1;...
2021-08-23 17:44:22
136
空空如也
将一个科学计数法的浮点数转换成一个在内存中存储的一个浮点数格式
2022-12-21
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅