摘要: #include<iostream> using namespace std; //define the node of a tree struct Node{ int data; Node* leftchild; Node* rightchild; Node() { leftchild = rig 阅读全文
posted @ 2021-04-26 22:41 关河梦断 阅读(71) 评论(0) 推荐(0) 编辑
摘要: QuickSort 1.综述 ​ 快速排序的思想和归并排序有一点类似,都是采用分治的思想,区别在于快速排序的关键在于 pivot 将整个序列区分成为比他大\比他小的两部分,而归并则是把序列分成了两个有序的序列。 ​ 快速排序的核心可以归结为以下几句话: 选择一个点作为 pivot(一般是最左边的点) 阅读全文
posted @ 2021-03-17 16:32 关河梦断 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 链表的操作复习 1.链表的建立,查找与删除 #include<Windows.h> #include<cstdio> using namespace std; struct Node{ int data; Node*next; }; //建立一个长度为n的非递减变量 Node* Build(Node 阅读全文
posted @ 2021-03-11 14:51 关河梦断 阅读(50) 评论(0) 推荐(0) 编辑
摘要: MergeAndCount_Fighting strength vs Equipment 1.Discription: If you play games, you will know the importance of your equipment. However, your equipment 阅读全文
posted @ 2021-03-11 14:21 关河梦断 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 简单类worker的实现 一、worker.h:类的设计 #pragma once #ifndef __WORKER__ #define __WORKER__ class worker { private: int id; char *name; float wage; char level;//A 阅读全文
posted @ 2020-12-08 23:11 关河梦断 阅读(176) 评论(0) 推荐(0) 编辑