![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
文章平均质量分 74
Velconias
Always a long way to go
展开
-
【试着自己写一个STL 】Knife_STL —— alloc.h
#ifndef KNIFE_ALLOC_H #define KNIFE_ALLOC_H #include "config.h" #include "knifeio.h" #include #include // 通常写注释会中英混杂,其实我英文也不是很好,主要是懒得切换输入法了,就当练练口语交际 // 这次实现的就是STL的重要部分了:allocator // 仍旧是SGI_STL 203原创 2014-01-22 01:37:56 · 931 阅读 · 0 评论 -
【算法导论】快速排序实现
#ifndef QUICK_SORT_H #define QUICK_SORT_H #define QK_SORT #include #include #include "INSERTION-SORT.h" #ifdef _DEBUG #include #endif // _DEBUG /////////////////////////////////////////////////原创 2014-03-08 21:37:44 · 859 阅读 · 0 评论 -
【算法导论】堆排序实现
#ifndef HEAP_SORT_H #define HEAP_SORT_H #include #include #include #ifdef _DEBUG #include #endif // _DEBUG ////////////////////////////////////////////////////////////////////////// // 最大堆,用于实现堆原创 2014-03-05 16:23:20 · 945 阅读 · 0 评论 -
【算法导论】计算多项式实现
#ifndef POLYNOMIAL_COMPUTE_H #define POLYNOMIAL_COMPUTE_H ////////////////////////////////////////////////////////////////////////// // 多项式计算: // 霍纳规则 T = a0 + x(a1 + x(a2 + .... + x(an-1 + xan)...)原创 2014-03-03 21:08:29 · 938 阅读 · 0 评论 -
【算法导论】归并排序实现
#ifndef MERGE_SORT_H #define MERGE_SORT_H #include #include #include #include "INSERTION-SORT.h" ////////////////////////////////////////////////////////////////////////// // 合并排序: // 最佳情况: n*lg原创 2014-03-03 21:05:22 · 732 阅读 · 0 评论 -
【算法导论】插入排序实现
#ifndef INSERTION_SORT_H #define INSERTION_SORT_H #include ////////////////////////////////////////////////////////////////////////// // 插入排序: // 最坏情况:逆序数组 cn^2 + n = n^2 + n // 一般情况:n(原创 2014-03-03 21:03:24 · 623 阅读 · 0 评论 -
【试着自己写一个STL 】Knife_STL —— config.h
#ifndef CONFIG_H #define CONFIG_H #define _STL_NAMESPACE_BEGIN namespace knife { #define _STL_NAMESPACE_END } _STL_NAMESPACE_BEGIN // define different size type by basic type #define Byte ch原创 2014-01-22 01:42:28 · 716 阅读 · 0 评论 -
【试着自己写一个STL 】Knife_STL —— pair.h
#ifndef KNIFE_PAIR_H #define KNIFE_PAIR_H #include "config.h" #include _STL_NAMESPACE_BEGIN template struct pair { typedef A_Type first_type; typedef B_Type second_type; A_Type first; B_Type原创 2014-01-22 01:41:03 · 751 阅读 · 0 评论 -
【试着自己写一个STL 】Knife_STL —— algobase.h
#ifndef KNIFE_ALGOBASE_H #define KNIFE_ALGOBASE_H // 这个头文件看似是由一个个基础函数构成的算法库 // 但其实这些算法大部分都是基于iterator这个概念的,即 // 基于iterator的相关全局基础方法,使iterator在被使用 // 的时候更加得心应手;这些方法包括: // iter_swap(); // distance(); a原创 2014-01-22 01:39:18 · 803 阅读 · 0 评论 -
【LeetCode】LRU Cache
LeetCode - LRU Cache 复杂度为O(1)的C++解决方案原创 2014-10-08 15:53:43 · 960 阅读 · 0 评论