资源简介
libcstl是使用C语言编写的一个通用的数据结构和常用的算法库,它模仿SGI STL的接口和实现,支持vector,list,deque等等常用的数据结构,同时还支持排序,查找,划分等常用的算法,此外libcstl也包含迭 代器的类型,它作为容器和算法之间的桥梁。libcstl为C语言编程中的数据管理提供了便利。
代码片段和文件信息
/*
* The implementation of algorithm.
* Copyright (C) 2008200920102011 Wangbo
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston MA 02110-1301 USA
*
* Author e-mail: activesys.wb@gmail.com
* activesys@sina.com.cn
*/
/** include section **/
#include
#include
#include
#include
#include
#include
#include se.h>
#include se_private.h>
#include
#include
#include
/** local constant declaration and local macro section **/
#define _CSTL_SORT_THRESHOLD 16 /* the threshold of insert sort and quick sort */
/** local data type declaration and local struct union enum section **/
/** local function prototype section **/
/*
* Partition with bidirectional_iterator_t.
*/
static bidirectional_iterator_t _partition_biditer(
bidirectional_iterator_t t_first bidirectional_iterator_t t_last
unary_function_t t_unary_op);
/*
* Rotates the elements in the range [t_first t_last).
*/
static void _rotate_forward(
forward_iterator_t t_first
forward_iterator_t t_middle
forward_iterator_t t_last);
/*
* The implement of insertion sort.
*/
static void _insertion_sort_if(
random_access_iterator_t t_first random_access_iterator_t t_last
binary_function_t t_binary_op char* pc_value);
/*
* Return the median of three random_access_iterator_t
*/
static random_access_iterator_t _median_of_three_if(
random_access_iterator_t t_first
random_access_iterator_t t_middle
random_access_iterator_t t_last
binary_function_t t_binary_op);
/*
* Compute the logarithm of t_n.
*/
static size_t _lg(size_t t_n);
/*
* The implement of intro sort.
*/
static void _intro_sort_if(
random_access_iterator_t t_first random_access_iterator_t t_last
binary_function_t t_binary_op size_t t_depth char* pc_value);
/** exported global variable definition section **/
/** local global variable definition section **/
/** exported function implementation section **/
output_iterator_t algo_set_union(
input_iterator_t t_first1 input_iterator_t t_last1
input_iterator_t t_first2 input_iterator_t t_last2
o
相关资源
- 校园导游源代码程序C++
- 数据结构课程设计 山东大学版 文件
- 数据结构课程设计(C++代码+报告)
- 数据结构与算法分析 C++语言描述 第二
- C++ 数据结构 迷宫求解
- 数据结构与算法分析(C++版)张铭译
- 文本编辑器(报告+源代码) MFC VC 数
- 严蔚敏数据结构C语言版视频教程之总
- MFC 图数据结构 最短路径
- 数据结构—使用C语言第4版
- 航空客运订票系统数据结构课程设计
- C++ 学籍管理系统
- 数据结构与算法分析:C语言描述(原书
- 南邮《数据结构-C语言描述》陈慧南主
- 数据结构基础(C语言版) 习题答案
- c++数据结构实现经典背包问题
- 数据结构课程设计:表达式求值,C
- 数据结构c语言版本严蔚敏清华大学
- 数据结构c语言版本
- 数据结构(C++版) 唐宁九
- 数据结构算法设计C++,乐学答案
- 数据结构与算法分析C++版 Clifford A.
- 数据结构C语言版第2版课后习题答案
- 哈工大软件学院07级数据结构课程设计
- 单向链表类模板全C++
- 数据结构C++语言进出堆栈动画
- 数据结构课程设计图书管理系统c语言
- c++数据结构 算法模板
- 哈夫曼编码译码器数据结构
- 数据结构C语言版(经典绝版)清华大
评论
共有 条评论