
数据结构
turn__back
这个作者很懒,什么都没留下…
展开
-
数据结构-排序算法集合(包含所有排序)
1.比较排序: 1).插入排序(直接插入排序、希尔排序) 2).选择排序(选择排序、堆排序) 3).交换排序(冒泡排序、快速排序) 4).归并排序(归并排序) 2.非比较排序: 1).计数排序 2).基数排序(LSD、MSD)原创 2017-03-09 13:27:35 · 238 阅读 · 0 评论 -
数据结构-红黑树(RBTree)
#pragma once enum Color { RED, BLACK }; template struct RBTreeNode { K _key; V _value; Color _col; RBTreeNode* _left; RBTreeNode* _right; RBTreeNode* _parent; RBTreeNode(const K& key,原创 2017-03-08 11:29:32 · 480 阅读 · 0 评论 -
数据结构-二叉搜索树
#pragma once //K/V模型(key/value) //运用:英汉互译 template struct SearchBinaryTreeNode { SearchBinaryTreeNode* _left; SearchBinaryTreeNode* _right; const K _key; //eg:英译汉 V _value; SearchBinaryTre原创 2017-03-07 17:17:47 · 280 阅读 · 0 评论 -
数据结构-堆(Heap)
#include #include using namespace std; template struct Bigger { bool operator()(T left, T right) { return left > right; } }; template struct Lower { bool operator()(T left, T right) { re原创 2017-03-06 23:09:41 · 338 阅读 · 0 评论 -
数据结构-二叉树线索化迭代器(续上节)
#pragma once #include using namespace std; enum Type { LINK, //指针指向的是一颗子树 THREAD //指针指向的是线索化 }; template struct BinaryTreeThdNode //二叉树的节点结构 { T _data; BinaryTreeThdNode* _left; BinaryTr原创 2017-03-05 19:12:57 · 324 阅读 · 0 评论 -
数据结构-二叉树的线索化
主要代码实现: #pragma once #include using namespace std; enum Type { LINK, //指针指向的是一颗子树 THREAD //指针指向的是线索化 }; template struct BinaryTreeThdNode { T _data; BinaryTreeThdNode* _left; BinaryTreeThd原创 2017-03-05 15:33:15 · 313 阅读 · 0 评论 -
数据结构-广义表
广义表是非线性的结构,是线性表的一种扩展,是有n个元素组成有限序列。 广义表的定义是递归的,因为在表的描述中又得到了表,允许表中有表。 A = () B = (a,b) C = (a,b,(c,d)) D = (a,b,(c,d),(e,(f),h)) E = (((),())) 主要代码: //广义表结构(链表套链表) #pragma once #原创 2017-03-04 19:39:55 · 415 阅读 · 0 评论 -
数据结构-二叉树(包含递归和非递归版本)
#pragma once #include #include #include using namespace std; template struct BinaryTreeNode { T _value; BinaryTreeNode* _leftchild; BinaryTreeNode* _rightchild; BinaryTreeNode(const T& x)原创 2017-02-25 19:09:38 · 146 阅读 · 0 评论