- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 顺序队列的相关代码
# include using namespace std; template class queue { public : void clear(); bool enqueue (const T item); bool dequeue(T & item); bool getfront(T & item); bool isempty(); bool isfull();
2012-04-02 11:08:21 764 1
原创 朴素模式配对算法
此段代码是我在数据结构课上敲的代码,仅供大家参考 #include #include using namespace std; void main() { string s1,s2; cout cin>>s1; cout cin>>s2; int n1,n2; n1=s1.length(); n2=s2.length(); cout cout int i,j,suc
2012-04-02 11:05:46 577
原创 判断字符串是否对称
此段代码是用户输入字符串,然后判断字符串是否对称。 #include #include using namespace std; int main() { char a[200]; int i,n; cout cin>>a; n=strlen(a); for(i=0;i { if(a[i]!=a[n-i-1]) { cout return 0; break;}
2012-04-02 11:03:31 922
原创 数据结构中链表的建立代码
此段代码的命名我用的是6,因此下面是# include "6.h",大家不要像我这样利用数字命名,要利用相关的英文,是大家容易懂 # include using namespace std; template class cnode { public: T value; cnode *next; cnode(T val,cnode *nex=NULL) { value=v
2012-04-02 11:00:56 806
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人