![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
文章平均质量分 55
nI丶唯一
这个作者很懒,什么都没留下…
展开
-
Linux下的守护进程
Linux下的守护进程原创 2022-09-28 09:14:25 · 228 阅读 · 0 评论 -
QT:TestProperty
mypropertyclass.h#ifndef MYPROPERTYCLASS_H#define MYPROPERTYCLASS_H#include <QObject>class MyPropertyClass : public QObject{ //使用信号和槽 Q_OBJECT //使用动态属性 Q_PROPERTY(QString mask READ mask WRITE setMask NOTIFY maskChanged)public:原创 2020-11-18 19:21:05 · 160 阅读 · 0 评论 -
QT:singal信号和槽
#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>QT_BEGIN_NAMESPACEnamespace Ui { class MainWindow; }QT_END_NAMESPACEclass MainWindow : public QMainWindow{ Q_OBJECTpublic: MainWindow(QWidget *parent = nullptr); ~M原创 2020-11-18 19:15:59 · 130 阅读 · 0 评论 -
MYSQL笔记
CREATE DATABASE 库名; /*创建数据库*/SHOW databases; /*查看所有数据库*/use 库名; /*选择数据库*/drop database 库名; /*删除数据库*/show tables; /*查看所有表*/create table class(id int, name varchar(128), teacher varchar(64));/*创建表class*/insert into class values(101,'六年级一班','马原创 2020-09-28 12:39:15 · 89 阅读 · 0 评论 -
A*算法
Astar.cpp#include<math.h>#include"Astar.h"#include<iostream>#include<vector>static int *maze; //迷宫对应的二维数组,用一级指针表示static int cols; //二维数组对应的列数static int lines; //二维数组对应的行数static list<Point *> openlList; //开放列表static list原创 2020-09-25 10:44:30 · 96 阅读 · 0 评论 -
查找算法
并行搜素#include<iostream>#include <stdio.h>#include <iostream>#include <time.h>using namespace std;#define TEST_SIZE (1024*1024*200)#define NUMBER 20typedef struct _search { int *data;//搜索的数据集 size_t start; //搜索的开始位置 size_原创 2020-09-25 10:41:33 · 64 阅读 · 0 评论 -
五大核心算法
动态规划算法#include<iostream>using namespace std;/*递归实现机器人台阶走法统计参数: n - 台阶个数返回:上台阶总的走法f(n) = f(n-1) + f(n-2);*///分治算法int WalkCount1(int n){ if (n < 0) return 0; if (n == 1) return 1; //一级台阶,一种走法 else if (n == 2) return 2; //二级台阶,两种原创 2020-09-25 10:39:39 · 2805 阅读 · 0 评论 -
七大排序算法
插入排序#include<iostream>/*插入排序*/void InsertSort(int arr[], int len){ int preIndex = 0, current = 0; for (int i = 1; i < len; i++) { preIndex = i - 1; current = arr[i]; while (preIndex >= 0 && arr[preIndex] > current)原创 2020-09-25 10:37:10 · 119 阅读 · 0 评论 -
数据结构c++代码实现
顺序表#include<iostream>#include<string>using namespace std;//#define MAX_SIZE 100////typedef struct //{// int *elems; //顺序表的基地址// int length; //长度// int size; //总空间大小//}SqList;template <typename T>class SqList{public:原创 2020-09-25 10:33:49 · 2974 阅读 · 0 评论 -
C++:STL-常用集合算法
#include<iostream>#include<algorithm>#include<vector>using namespace std;//set_intersection 求两个容器的交集,返回最后一个元素位置//两个容器必须是有序的void test01(){ vector<int>v1 = { 0,1,2,3,...原创 2020-04-29 10:35:42 · 219 阅读 · 0 评论 -
C++:STL-常用算术生成算法
#include<iostream>#include<numeric>#include<vector>using namespace std;//算术生成算法属于小型算法,包含头文件numeric//accumulate 计算容器区间内元素累加总和void test01(){ vector<int>v1 = { 0,1,2,...原创 2020-04-29 10:35:02 · 172 阅读 · 0 评论 -
C++:STL-常用拷贝和替换算法
#include<iostream>#include<algorithm>#include<vector>using namespace std;//copy 将容器指定范围内的元素拷贝到另一容器中void vPrint(int num){ cout << num << " ";}void test01(){...原创 2020-04-29 10:34:07 · 127 阅读 · 0 评论 -
C++:STL-常用排序算法
#include<iostream>#include<algorithm>#include<vector>#include<functional>#include<ctime>using namespace std;//sort排序class nSort{public: bool operator()(int ...原创 2020-04-29 10:33:07 · 186 阅读 · 0 评论 -
C++:STL-常用查找算法
#include<iostream>#include<algorithm>#include<functional>#include<vector>#include<string>using namespace std;//find 查找元素,内置类型void test01(){ vector<int>v...原创 2020-04-29 10:31:46 · 161 阅读 · 0 评论 -
C++:STL-常用遍历算法
#include<iostream>#include<algorithm>#include<functional>#include<vector>using namespace std;//常用遍历算法for_each//普通函数void print(int val){ cout << val << "...原创 2020-04-29 10:30:32 · 190 阅读 · 0 评论 -
C++:函数对象-内建函数
逻辑仿函数#include<iostream>#include<functional>#include<vector>#include<algorithm>using namespace std;//逻辑非 logical_notvoid test01(){ vector<bool>v; v.push_bac...原创 2020-04-29 10:27:53 · 484 阅读 · 0 评论 -
C++:STL之map
#include<iostream>#include<map>using namespace std;//map中所有元素都是pair值,性能高//第一个元素为key(键值),起到索引作用,第二个元素为value(实值)//所有元素会根据键值排序,关联式容器底层是二叉树//打印函数void printMap(map<int, int>...原创 2020-04-29 10:21:44 · 105 阅读 · 0 评论 -
C++:STL之set
#include<iostream>#include<set>#include<string>using namespace std;//关联式容器,底层是二叉树,插入时自动排序//set不允许有重复的元素//multiset允许有重复的元素//遍历void printSet(set<int>&s){ for ...原创 2020-04-29 10:19:48 · 131 阅读 · 0 评论 -
C++:STL之list
#include<iostream>#include<list>using namespace std;//双向循环链表容器//迭代器只支持前移一位和后移一位,不能跳着访问//动态存储分配,不会造成内存浪费,删除插入方便只需改动指针//空间和时间耗费较大//打印函数void printList(list<int>&L){...原创 2020-04-29 10:15:49 · 166 阅读 · 0 评论 -
C++:STL之queue
#include<iostream>#include<queue>using namespace std;//队列容器,不能遍历,先进先出int main(){ //构造函数 queue<int>q1; //拷贝构造 queue<int>q2(q1); //=赋值 queue<int>q3 = q2; //...原创 2020-04-29 10:11:38 · 222 阅读 · 0 评论 -
C++:STL之stack
#include<iostream>#include<stack>using namespace std;//栈容器,不能遍历,先进后出int main(){ //默认构造 stack<int>stk1; //拷贝构造 stack<int>stk2(stk1); //赋值 stack<int>stk3 =...原创 2020-04-29 10:09:45 · 127 阅读 · 0 评论 -
C++:STL之deque容器
包含头文件#include<iostream>#include<deque>#include<algorithm>using namespace std;打印函数void printfDeque(const deque<int>&d){ for (deque<int>::const_iterator it = ...原创 2020-04-14 13:14:21 · 146 阅读 · 0 评论 -
C++:STL之Vector
头文件包含#include <iostream>#include <string>#include<vector>using namespace std;打印函数void printVector(vector<int>&v){ for (vector<int>::iterator it = v.begin(); ...原创 2020-04-13 20:31:20 · 146 阅读 · 0 评论 -
C++:STL之String容器
#include <iostream>#include <string>#include<vector>using namespace std;//string的构造函数,在string类型中中文占两个位置void test01(){ //默认构造string(); string s; cout << s << en...原创 2020-04-13 11:35:14 · 106 阅读 · 0 评论 -
C++:模板
#include <iostream>#include <string>using namespace std;//函数模板,有自动类型推导,也可以使用显式指定类型template<typename T>void fun(T &a, T &b){ T temp = a; a = b; b = temp;}template&...原创 2020-04-11 00:54:27 · 61 阅读 · 0 评论 -
C++:二进制文件
#include<iostream>#include<fstream>using namespace std;class Person{public: char m_Name[64]; int m_Age;};//二进制写文件,存入类void test01(){ //创建流对象 ofstream ofs; ofs.open("person....原创 2020-04-02 11:36:02 · 147 阅读 · 0 评论 -
C++:文本文件读写
必须包含头文件#include<fstream>三种方式 ifstream 读文件 ofstream 写文件 fstream 读写文件//创建流对象fstream iof;//iof对象名iof.open("路径名",打开方式);//关闭文件iof.close();#include<iostream>#include<...原创 2020-04-01 13:39:00 · 246 阅读 · 0 评论 -
C++:运算符重载(详)
#include <iostream>#include <string>using namespace std;class Num{ friend ostream& operator<<(ostream&, Num&); friend istream& operator>>(istream&, Nu...原创 2020-03-24 23:50:33 · 109 阅读 · 0 评论 -
C++学习笔记:利用虚函数面积计算
抽象基类Shape.h#pragma onceclass Shape{public: virtual void shapeName()const = 0; //定义两个纯虚函数 virtual void printArea()const = 0; //输出面积};圆形Circle.h#pragma once#include "Shape.h"#include&l...原创 2020-02-10 23:33:22 · 528 阅读 · 0 评论 -
C++学习笔记:运算符重载
Myclass.h#pragma once#include <iostream>using namespace std;class Myclass{public: Myclass(); Myclass(int value) : m_value(value) { } //重载+号运算符 const Myclass operator+(const Myclass &...原创 2020-01-29 12:41:43 · 277 阅读 · 0 评论 -
C++学习笔记:类
头文件student.h#pragma once#include <string>#include <iostream>using namespace std;class student{public: //公有的 student(); //构造函数 /* 重载构造函数 */ student(int,string,char); //构...原创 2020-01-26 12:01:13 · 176 阅读 · 0 评论 -
C++:指针的用法以及一些其他内容
#include <iostream>#include <Windows.h>#include <vector>#include <algorithm>using namespace std;int main(){ //指针 double num = 1024.5; double* ptr_num = # void...原创 2020-01-14 18:59:11 · 128 阅读 · 0 评论 -
C++学习笔记:常对象
常对象数据成员只能通过构造函数的参数初始化表对常数据成员进行初始化,任何其他函数都不能对常数据成员赋值。如:const int hour;下面用法是非法的:Time::Time(int h){ hour=h;}因为常数据成员是不能被赋值的。常成员函数如果将成员函数声明为常成员函数,则只能引用本类中的数据成员,而不能修改它们。列如:void get_time()cons...原创 2020-01-23 14:22:06 · 232 阅读 · 0 评论 -
C++学习笔记:结构体的一些用法,以及通过结构体和指针搭建的单向静态链表。
#include <iostream>#include <Windows.h>#include <string>using namespace std;struct Date{ int year; int month; int day;};struct Student{ int num;//学号 string name;//姓名 i...原创 2020-01-18 20:44:57 · 205 阅读 · 0 评论