资源简介
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语言版源代码
- DSDEMO-C演示(数据结构C语言版 严蔚敏
- 数据结构 图的遍历源代码
- 数据结构实验源代码集
- 实验报告:数据结构长整数四则运算
- 数据结构教程李春葆第五版书中例题
- 吕鑫vc6c++数据结构视频源码
- 数据结构教程李春葆第五版课后答案
- 李春葆课后习题答案(数据结构教材
- 数据结构1800题 题+答案(全)
- 数据结构(C语言版)ppt课件,清华,
- c++常用游戏算法及数据结构设计
- 数据结构超全面复习导图
- 《Data Structures and Algorithm Analysis in C
- 数据结构C语言版教学笔记严蔚敏
- 数据结构C语言版期末考试试题(有答
- 多功能计算器实现C++代码以及代码详
- C语言数据结构银行客户排队
- C语言实现栈操作
- 简易学生管理系统源码 数据结构 大作
- 数据结构与C语言综合习题集
- 数据结构实验——赫夫曼树相关
- C语言进阶源码---基于graphics实现图书
- 数据结构——C++语言描述 陈慧南
- 广东工业大学数据结构课程设计航空
- 数据结构课程设计扑克牌排序
- 数据结构各种算法实现(C++模板),
- (严版C语言版数据结构源码.rar
川公网安备 51152502000135号
评论
共有 条评论