摘要: ——找东西,是个很重要的命题。 顺序查找和字符串匹配也是蛮力求解的典范。 顺序查找 template<typename ObjectType> int Find( ObjectType *arr,int arrLen,ObjectType findItem ) { for (int i=0;i<arrLen;++i) { ... 阅读全文
posted @ 2012-08-28 22:00 sharpfeng 阅读(308) 评论(0) 推荐(0) 编辑
摘要: ——在没有稳当的走之前,先不要急着跑。 排序方法中的选择排序和冒泡排序均属蛮力法,即以常规的、也是易于理解的方式解决问题。 #ifndef _FENGSORT_H_ #define _FENGSORT_H_ #include "basic_head.h" template<typename ObjectType> class e... 阅读全文
posted @ 2012-08-28 11:20 sharpfeng 阅读(320) 评论(0) 推荐(0) 编辑