摘要:
栈 栈结构定义 & 初始化 typedef struct Stack{ int data[MAX_SIZE]; int top; }SqStack; void InitStack(SqStack &s){ s.top = -1; // 栈顶指针指向当前元素位置,初始化为-1 } 判断栈空 // 判断 阅读全文
摘要:
二分板子 #include <iostream> constexpr int N = 100; int main(){ int a[N]; int n; std::cin >> n; for(int i=0; i<n; i++) std::cin >> a[i]; int l = 0, r = n 阅读全文
摘要:
链表 链表结构定义 // 链表结构定义 typedef struct LNode{ int data; struct LNode* next; }LNode, *LinkList; 初始化链表 // 初始化链表 bool InitList(LinkList &L){ L = new LNode; L 阅读全文
摘要:
原生并行版std::accumulate 代码来自《c++并发编程实战》 #include <iostream> #include <numeric> #include <algorithm> #include <thread> #include <functional> #include <v 阅读全文
摘要:
MIPS 项目仓库请见https://github.com/ZhangFirst1/MIPS 使用Verilog实现的Mips CPU,实现了简易的五级流水。项目使用Vivado构建。 实现了ori、or、and、xor、sll、jal、beq、sw、lw、subu、addu指令。解决了流水线数据相 阅读全文
摘要:
WebServer(暂未写完) 根据项目https://github.com/markparticle/WebServer实现的c++服务器项目。同时参考JehanRio的博客https://blog.csdn.net/weixin_51322383/article/details/130464 阅读全文
摘要:
cpp笔记 请见: 序言 现代 C++ 教程: 高速上手 C++ 11/14/17/20 - Modern C++ Tutorial: C++ 11/14/17/20 On the Fly (changkun.de) 1. 指针常量和常量指针 1.指针常量:不能修改指针所指向的地址。定义同时必须 阅读全文
摘要:
小部分算法总结 部分题目请见: https://github.com/ZhangFirst1/Algorithm-problem-code 异或运算 a^= b相当于a=a^b,将十进制数字转化为二进制进行运算,相同为0,相异为1,0和任何数异或运算都是原来的那个数。 可以用来判断数组中哪个数字只出 阅读全文
摘要:
Breakout 简介 - LearnOpenGL CN (learnopengl-cn.github.io) 2D游戏BreakOut实现以及对OpenGL一些知识点的总结。 1.项目结构 game类:用于管理所有游戏和渲染代码,提供初始化、游戏重置、键盘输入、更新游戏状态、渲染、碰撞检测 阅读全文
摘要:
tinyrenderer 跟着ssloy/tinyrenderer: A brief computer graphics / rendering course (github.com)项目实现一个基础的渲染器。 ZhangFirst1/tinyrenderer: 跟随tinyrenderer 阅读全文