随笔分类 -  数据结构与算法

摘要:转载:知无涯之std::sort源码剖析 阅读全文
posted @ 2021-07-17 16:44 Vzf 阅读(66) 评论(0) 推荐(0)
摘要:#pragma once #include #include using namespace std; enum RBTreeColor { RED, BLACK }; template struct RBTreeNode { RBTreeNode(T value, RBTreeColor c) : key(value), color(c), ... 阅读全文
posted @ 2020-01-03 16:12 Vzf 阅读(176) 评论(0) 推荐(0)
摘要:#pragma once #include <iostream> #include <algorithm> template <typename T> class AVLTreeNode { public: T key; int height; AVLTreeNode* left; AVLTreeNode* right; AVLTreeNode(T value, AVLTreeNode *l, A 阅读全文
posted @ 2019-12-27 15:15 Vzf 阅读(171) 评论(0) 推荐(0)
摘要:1 #ifndef BSTREE_H 2 #define BSTREE_H 3 4 #include <iostream> 5 6 template <typename T> 7 class BSTreeNode { 8 public: 9 T key; 10 BSTreeNode *left; 11 BSTreeNode *right; 12 BSTreeNode *parent; 13 BST 阅读全文
posted @ 2019-12-26 19:45 Vzf 阅读(438) 评论(0) 推荐(0)