工具类
外太空の神
这个作者很懒,什么都没留下…
展开
-
random(随机函数生成)
random(随机函数生成)#ifndef C11LEARN_RANDOM_H#define C11LEARN_RANDOM_H#include <time.h>#include <stdlib.h>int random_include_left_right(int left,int right);int random_only_include_left(int left,int right);int random_only_include_right(int left原创 2021-07-17 19:51:45 · 329 阅读 · 0 评论 -
辅助类Chain
辅助类Chain#ifndef C11LEARN_CHAIN_H#define C11LEARN_CHAIN_Htemplate<typename T>class Chain{public: int key; T value; Chain<T> *prev; Chain<T> *next;public: Chain(){} Chain(int key,const T value):key(key),value原创 2021-07-16 20:53:21 · 80 阅读 · 0 评论 -
辅助类KeyNode
#ifndef C11LEARN_KEYNODE_H#define C11LEARN_KEYNODE_Htemplate<typename T>class KeyNode{public: int key{}; T value;public: KeyNode()= default; KeyNode(int key,const T value):key(key),value(value){}};#endif //C11LEARN_KEYNODE_H原创 2021-07-15 08:57:09 · 212 阅读 · 0 评论 -
辅助类BinaryTreeNodeLeftChildRightSibling(左孩子右兄弟,二叉树结点)
辅助类BinaryTreeNodeLeftChildRightSibling(左孩子右兄弟,二叉树结点)template<typename T>class BinaryTreeNodeLeftChildRightSibling{public: T key; BinaryTreeNodeLeftChildRightSibling<T>* parent; BinaryTreeNodeLeftChildRightSibling<T>* left_原创 2021-07-14 10:20:09 · 237 阅读 · 0 评论 -
辅助类BinaryTreeNode(二叉树节点)
辅助类BinaryTreeNode(二叉树节点)template<typename T>class BinaryTreeNode{public: T key; BinaryTreeNode<T>* parent; BinaryTreeNode<T>* left; BinaryTreeNode<T>* right;public: BinaryTreeNode(){} BinaryTreeNode(T k原创 2021-07-13 21:53:13 · 661 阅读 · 0 评论 -
辅助类BinaryTreeNodeIndex(用index索引代替指针)
辅助类BinaryTreeNodetemplate<typename T>class BinaryTreeNode{public: T key; int left; int right;public: BinaryTreeNode(){} BinaryTreeNode(const T key,int left = -1,int right = -1):key(key),left(left),right(right){}};原创 2021-07-13 20:36:07 · 85 阅读 · 0 评论 -
快速排序和选择模版类
快速排序和选择模版类template<typename T>void insert_sort(T *array,int start,int end){ for (int i = start + 1; i < end + 1; ++i) { int j = i - 1 ; T key = array[i]; while (j >= start && key < array[j]) {原创 2021-07-09 08:52:20 · 99 阅读 · 0 评论 -
工具类—KeyValuePair
工具类KeyValuePair.h文件#ifndef C11LEARN_KEYVALUEPAIR_H#define C11LEARN_KEYVALUEPAIR_Hclass KeyValuePair {public: int key; int value;public: KeyValuePair(); KeyValuePair(int key,int value);};#endif //C11LEARN_KEYVALUEPAIR_H.cpp文件#i原创 2021-07-04 11:48:42 · 164 阅读 · 0 评论