自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (2)
  • 收藏
  • 关注

原创 windows python2.6 django 开发环境搭建

一、需要下载的工具:python2.6PIL-1.1.6.win32-py2.6Django-1.1.1 (非常有用的教程:Django Step by Step)apache_2.2.14mod_python-3.3.1.win32-py2.6-apache2.2MySQLMySQL-python-1.2.2libguide40.dll libmmd.dll

2009-12-30 15:37:00 2902 1

原创 归并排序与求逆序数的算法

归并排序算法就不多说了。时间复杂度及最坏情况下的时间复杂度为O(NlogN), 空间复杂度为O(N). 存在问题: 1. 附加内存 2. 数据拷贝到临时数组,然后拷贝回来的操作放慢了排序的速度。 因此,对于内存排序,一般用快速排序。 上归并排序的代码: 隐藏行号 复制代码 ? 归并排序 #include#includetypedef int ElementType;

2009-12-17 00:18:00 696 1

原创 代码模板

这是做POJ时为方便测试写的个模板,贴出来放这儿,以后去POJ水题的时候说不定能用得到。 隐藏行号 复制代码 ? .cpp #define DEBUG#includeusing std::cin;using std::cout;using std::endl;#ifdef DEBUG#include#includeus

2009-12-14 15:28:00 388

原创 栈的实现

隐藏行号 复制代码 ? .h #ifndef __STACK_H#define __STACK_H/*array stack*/namespace dskit{ struct StackRecord; typedef struct StackRecord* Stack; #ifndef NULL

2009-12-14 15:15:00 597

原创 c++实现单例模式

隐藏行号 复制代码 ? Demo class singleton{public: static singleton instance; static singleton& getInstance(); int i;private: singleton(){}};.src_containe

2009-12-14 15:12:00 362

原创 快速排序

上代码,呵呵…   隐藏行号 复制代码 ? Demo #ifndef __QSORT_H#define __QSORT_H#define CUTOFF (3)typedef int ELEMENTSTYPE;void QSort(ELEMENTSTYPE A[], int left, int right);void InsertSort(EL

2009-12-14 11:10:00 396

原创 求多项式的值与求幂的快速算法

隐藏行号 复制代码 ? Demo #includeint power(int x, int p){ if(1 == p) return x; if(0 == (p % 2)) return power(x * x, p / 2); else return power(

2009-12-14 11:06:00 683

原创 求最大子序列和的两种算法

隐藏行号 复制代码 ? Demo /**author: Jack.xu/nanac.xu*date: 08/26/2009*function: max subsequence sum*/#include#includenamespace dskit{/*with O(N) time complexity*/in

2009-12-14 11:01:00 463

原创 动态规划之最长公共子序列

简单的纯粹的动态规划思想,直接上代码: 隐藏行号 复制代码 ? Demo #include#include#includeusing std::cout;using std::endl;using std::string;std::ifstream cin("dp_lcs.in");char a[5000], b[5000];

2009-12-14 10:57:00 426

原创 十进制到n进制的转换

隐藏行号 复制代码 ? Demo //n is the base, translate m to n baseint d2n_base(int m, int n, int* buffer) { int r = 0; int index = 0; while(r = m % n, m = m / n) { bu

2009-12-14 10:40:00 568

原创 排列组合的实现

排列: 隐藏行号 复制代码 ? Demo #include #include#define ELEMENT std::stringnamespace dskit{typedef void (*PrintFunc)(const ELEMENT* elements, const size_t size);class perm{

2009-12-14 10:37:00 1923

原创 两个小程序:atoi & 统计整数的二进制表示里有几个1

atoi: 隐藏行号 复制代码 ? Demo #includeint atoi(const char* str){ assert(NULL != str); while( == *str) ++str; bool sign_flag = 0; if(- ==

2009-12-14 10:27:00 477

原创 二叉查找树的实现(BST)

用C风格写的代码,可能用模块写更有利于应用。不过在C++里有map,set之类的容器,也不愿再去折腾了。 隐藏行号 复制代码 ? Demo #ifndef __BINARY_SEARCH_TREE_H#define __BINARY_SEARCH_TREE_H#includenamespace dskit{ typedef int ELEMENTS

2009-12-14 10:21:00 400

原创 算术表达式求值

闲来没事的时候写了个算术表达式求值的程序,还不够完善…估计也没有时间去完善了。 用的是中缀表达式转后缀表达式,另外还有的方法是用二叉树。 隐藏行号 复制代码 ? Demo /*??????????????????????????????????????????????????????????????????*/#ifndef __ARITHMETIC_EXPRESSION_H

2009-12-14 10:14:00 655

原创 Trie 字典树

资料来源:http://www.cppblog.com/abilitytao/archive/2009/04/21/80598.html Trie, 又称字典树、单词查找树,是一种树形结构,用于保存大量的字符串。它的优点是:利用字符串的公共前缀来节约存储空间。相对来说,Trie树是一种比较简单的数据结构.理解起来比较简单,正所谓简单的东西也得付出代价.故Trie树也有它的缺点,Trie树的内存消

2009-12-09 18:31:00 1067 1

原创 C++中堆的应用:make_heap, pop_heap, push_heap, sort_heap, priority_queue

C++中堆的应用:make_heap, pop_heap, push_heap, sort_heap, priority_queue make_heap, pop_heap, push_heap, sort_heap都是标准算法库里的模板函数,用于将存储在vector/deque 中的元素进行堆操作,对不愿自己写数据结构堆的C++选手来说,这几个算法函数很有用,下面是这几个函数操作vector中

2009-12-09 17:55:00 1536

linux timer

soft timer for higher performace

2010-12-13

ffmpeg example

ffmpeg 播放的例子,还有一个编译成功的ffmpeg自带的例子。

2010-04-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除