![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
文章平均质量分 80
v2nero
这个作者很懒,什么都没留下…
展开
-
算法导论C语言实现: 分治策略 -- 最大子数组问题
4.1 最大子数组问题 #include //FIND-MAX-CROSSING-SUBARRAY static void find_max_crossing_subarray( __in const int *A, __in int low, __in int mid, __in int high, __out int *max_left_index, __out int原创 2013-08-25 16:10:58 · 1202 阅读 · 0 评论 -
算法导论C语言实现: 堆排序
1. 源代码 #include typedef struct _heap_t { int length; //array length int size; //heap size int *data; } heap_t; #define PARENT(i) ((i-1)/2) #define LEFT(i) (2*i + 1) #define RIGHT(i) (2*i + 2)原创 2013-12-03 10:18:09 · 693 阅读 · 0 评论 -
算法导论C语言实现: 计数排序
#include //COUNTING-SORT //k: 0-k void COUNTING_SORT( __in sortdata_i_t *A, __out sortdata_i_t *B, __in int k) { int *C = (int *)malloc(sizeof(int)*(k + 1)); int i = 0; int j = 0; for (i = 0原创 2013-12-03 17:06:52 · 747 阅读 · 0 评论 -
算法导论C语言实现: 基本数据结构
1 stack 头文件 #ifndef __IA_STACK_H__ #define __IA_STACK_H__ #include typedef struct _iastack_t { int top; int size; int *data; } iastack_t; //return 0 for success // -1 for error int iasta原创 2013-12-12 11:15:08 · 660 阅读 · 0 评论 -
算法导论C语言实现: 红黑(red-black tree)
一、五条性质 1. Every node is either red or black. 2. The root is black. 3. Every leaf (NIL ) is black. 4. If a node is red, then both its children are black. 5. For each node, all simple paths from th原创 2014-02-13 19:41:33 · 1224 阅读 · 1 评论 -
动态库链接boost静态库
为了避免项目布署麻烦,需要将执行文件尽量静态链接 1. boost库全部静态链接 2. c++库静态链接 1,2点的改变如下,强制链静态库的方法为参数下为-l:libXXXX.a; 对于boost log, 需要将宏-DBOOST_LOG_DYN_LINK去掉 LOCAL_STATICLIBS := boost_log boost_log_setup boost_system boost...原创 2018-08-21 20:42:59 · 5118 阅读 · 1 评论