摘要: 1 /* 2 1.带头结点L的单链表结构 3 2.参照严慧敏单链表的链表结构 4 5 Levi 6 date:13.1.22 7 */ 8 9 #include <stdio.h> 10 #include "sys/malloc.h" 11 #include <stdlib.h> 12 #define ElemType int 13 14 15 struct LNode{ 16 ElemType data; 17 struct LNode * next; 18 }; 19 20 typedef struct LNode * LinkLis... 阅读全文
posted @ 2013-01-22 16:37 Levi_随云 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 1.严蔚敏书中的链表合并代码 3 4 Levi 5 date:13.1.22 6 */ 7 8 void MergeList(LinkList La,LinkList Lb,LinkList *Lc){ 9 LinkList pa=La->next,pb=Lb->next,pc;10 *(Lc)=pc=La;11 while(pa&&pb){12 if(pa->data<=pb->data){13 pc->next=pa;14 pc=pa;15 ... 阅读全文
posted @ 2013-01-22 15:37 Levi_随云 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 1.此方法是看着数据结构李葆春自写的顺序表 3 2.此方法Delete 还没限制i 范围。 4 3.此定义只是用来测试用 5 6 7 Levi. 8 date: 2013.1.21 9 */ 10 #include <stdio.h> 11 #define ElemType int 12 #define MAX_LEN 20 13 14 typedef struct { 15 ElemType data[MAX_LEN]; 16 int len; 17 }SqList; 18 19 20 void Print(SqL... 阅读全文
posted @ 2013-01-22 00:43 Levi_随云 阅读(213) 评论(0) 推荐(0) 编辑
摘要: /* c2-1.h 线性表的动态分配顺序存储结构 */ #define LIST_INIT_SIZE 10 /* 线性表存储空间的初始分配量 */ #define LIST_INCREMENT 2 /* 线性表存储空间的分配增量 */ typedef struct { ElemType *elem; /* 存储空间基址 */ int length; /* 当前长度 */ int listsize; /* 当前分配的存储容量(以sizeof(ElemType)为单位) */ }SqList;/* bo2-1.c 顺序表示的线性表(存储结构由c2-1.h定义)的基本操作(12个),... 阅读全文
posted @ 2013-01-22 00:28 Levi_随云 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 为MarsEdit登录用的password的。 2、在MarsEdit中新建一个blog的设置,把blog名称、网址填上。名称可以随便取,网址就有讲究了。我之前直接填ttp://xxxxx.spaces.live.com,就没法连接。查资料才发觉需要添加"/blog"字段再链接后头,比如上面那个网址应该填为http://xxxxx.spaces.live.com/blog/ 3、MarsEdit会... 阅读全文
posted @ 2013-01-20 13:54 Levi_随云 阅读(422) 评论(0) 推荐(0) 编辑
摘要: MAC系统打开txt文档的时候,经常会出现txt中文乱码现象,很郁闷啊。。。后来查到原来要解决这个问题很简单了啦~ 哈哈1. 打开mac系统的TextEdit,然后在左上角那个菜单里面,选择 文本编辑--偏好设置。2. 在偏好设置中选择第二个标签页(打开和存储),选择"纯文本文件编码"中的"打开文件"和存储文件"修改成为"中文(GB 18030)",就可以啦。下次打开txt文档就不会再乱码啦~~~ 哈哈 阅读全文
posted @ 2013-01-20 13:21 Levi_随云 阅读(308) 评论(0) 推荐(0) 编辑
摘要: vector容器类型 vector容器是一个模板类,可以存放任何类型的对象(但必须是同一类对象)。vector对象可以在运行时高效地添加元素,并且vector中元素是连续存储的。vector的构造 函数原型:template<typename T> explicit vector(); // 默认构造函数,vector对象为空 explicit vector(size_type n, const T& v = T()); // 创建有n个元素的vector对象 vector(const vector& x);... 阅读全文
posted @ 2012-10-17 14:11 Levi_随云 阅读(183) 评论(0) 推荐(0) 编辑
摘要: vector 顺序表操作1#include <iostream>using namespace std;#include <vector>using std::vector;#define MAX 100vector<int>ivec(MAX);vector<int>::iterator it;int len;void Output(){ int i; for (i=0;i<len;i++) { cout<<ivec[i]<<" "; } cout<<endl;} int main() 阅读全文
posted @ 2012-10-17 14:08 Levi_随云 阅读(195) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;#include <vector>using std::vector;vector<int> ivec;void out1(){ for(vector<int>::iterator it=ivec.begin();it!=ivec.end();it++) cout<<*it<<" "; cout<<endl;}int main(){ cout<<"size:"<<ivec 阅读全文
posted @ 2012-10-17 11:22 Levi_随云 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Description应用学过的朴素模式匹配算法或KMP匹配算法实现字符串替换功能(置换).(参考课堂教学内容)Input输入并显示三个字符串S,P,R;Output输出用字符串R替代字符串S中的所有子串P之后的新串.Sample Inputabcaabcaaabca bca xySample OutputaxyaxyaaxyHINT 阅读全文
posted @ 2012-10-16 15:21 Levi_随云 阅读(135) 评论(0) 推荐(0) 编辑