
算法
Michael@Wu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数组中只出现1次的两个数字
//问题描述:在一个数组中除两个数字只出现1次外,其它数字都出现了2次, 要求尽快找出这两个数字。//数组中只出现一次的两个数字 //---------------------------------- #include using namespace std; const int MAXN = 10; void FindTwoNotRepeat(int a[], int n, int *pN1原创 2013-03-10 21:27:55 · 677 阅读 · 0 评论 -
大数相加之我见
//本例实现正整数的大数相加 #include #include using namespace std; //------------------------- //全局变量 string s1,s2; int m[1002], n[1002]; //------------------------- int convert(string s1,string s2){ //将接原创 2013-03-01 20:18:59 · 440 阅读 · 0 评论 -
排序算法之快速排序
//This is about the quick sort. #include using namespace std; //--------------------------------- template void quicksort(T* a, int m, int n); //快速排序算法 template int partition(T* a, int m, int原创 2013-02-28 12:49:26 · 365 阅读 · 0 评论 -
简单网络爬虫Ruby版
这个程序写的很简单,主要完成的功能是到斯坦福大学的网站上去收集email地址,默认是10个线程,策略是广度优先,$debug=true时开启调试信息。附件中包含代码和批处理文件。原创 2014-06-30 15:59:24 · 3466 阅读 · 0 评论 -
STL容器 vector,list,deque 性能比较
STL容器类vector,list,deque的比较 C++的STL模板库中提供了3种容器类:vector,list,deque 对于这三种容器,在觉得好用的同时,经常会让我们困惑应该选择哪一种来实现我们的逻辑。 在少量数据操作的程序中随便哪一种用起来感觉差别并不是很大, 但是当数据达到一定数量后,会明显感觉性能上有很大差异。 本文就试图从介绍,以及性能比较两个方面来讨论转载 2014-07-04 17:20:23 · 3602 阅读 · 1 评论 -
重建二叉树
struct BTree{ int data; BTree * left原创 2014-09-18 10:30:57 · 642 阅读 · 0 评论 -
Ruby实现二叉树算法
# encoding: utf-8 class Tree public def initialize(data,left=nil,right=nil) @data = data @left = left @right = right end def selfdata @data end def leftchild @left en原创 2014-10-10 14:31:47 · 1760 阅读 · 0 评论