原创 簡單匹配算法

#include <iostream> using namespace std; int SimpleIndex(const string &T,const string &P,int pos=0) { int i=pos,j=0;

原创 線性鏈表之將單調遞增的la和lb中的數據元素按值遞增,將la和lb合併爲新的線性表lc,使lc中的元素仍然單調遞增

#ifndef _SIMPLELINKLIST_H_ #define _SIMPLELINKLIST_H_ #include "Node.h" using namespace std; enum StatusCode{SUCCESS,R

原创 雙向鏈表的實現

#ifndef _SIMPLEDBLLINKLIST_H_ #define _SIMPLEDBLLINKLIST_H_ #include <iostream> #include "NodeDbl.h" using namespace st

原创 順序表的頭文件和頭文件的實現

注意:1模板類中的函數有const,那麼定義此函數時const必須要有 2定義模板類的函數時,template<class ElemType>一定要有class #ifndef _SQLIST_H_ #define _SQLIST_H_

原创 用順序表求lc=la-lb

#ifndef _SQLIST_H_ #define _SQLIST_H_ #include <iostream> using namespace std; const DEFAULT_SIZE=10; enum StatusCode{

原创 用順序表調整la的左右兩邊,左邊元素全部爲奇數,右邊元素全部爲偶數

//#include "SqList.h" #include<iostream> using namespace std; const int Default=20; enum StatusCode{SUCCESS,RANGE_ERROR

原创 用順序棧解決將讀入的數按相反的方向解決

#ifndef _SQSTACK_H_ #define _SQSTACK_H_ #include <iostream> using namespace std; enum StatusCode{SUCCESS,RANGE_ERROR,O

原创 Myinterface

public class Computer { private int size; public Computer() { System.out.println("create a computer."); } public

原创 首尾字符匹配算法

#include <iostream> using namespace std; int FrontRearIndex(const string &T,const string &P,int pos=0) { int startPos

原创 鏈式棧

#include <iostream> #include "Node.h" #include "SimpleLinkStack.h" using namespace std; bool Merg(char *s) { char tmp

原创 鏈隊列

#ifndef _LINKQUEUE_H_ #define _LINKQUEUE_H_ #include "Node.h" #include <iostream> using namespace std; enum StatusCod

原创 KMP

#include <iostream> using namespace std; int KMPIndexHelp(const string &T,const string &P,int pos,int next[]) { int i

原创 翻轉線性表中的元素

#ifndef _NODE_H_ #define _NODE_H_ #include <iostream> using namespace std; template<class ElemType> class Node { publ

原创 用循環鏈表解決約瑟夫循環

注意1在getElemPtr的時候的position的範圍是0到Length() 2在約瑟夫循環中應爲出去的位置是position-1而出去了之後緊接着原來的元素位置被後面一個元素補上,所以position—1的位置 #include

原创 Android開發中Handler的經典總結

http://mobile.51cto.com/aprogram-442833.htm 當應用程序啓動時,Android首先會開啓一個主線程(也就是UI線程),主線程爲管理界面中的UI控件,進行事件分發。 AD:51CTO 網+ 第十二