上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 递归实现#include#define MAX 100int w[MAX]={0,1,2,3,4,5};int ans(int s,int m){ int s1,b,i; if(s==0)return 1; else if(s=0;i--) { ... 阅读全文
posted @ 2015-02-02 15:55 Thereisnospon 阅读(628) 评论(0) 推荐(0)
摘要: 递归实现#include#define MAX 100void print(int p[],int left,int right){ if(left<=right) { int mid=(left+right)/2; printf("%d\n",p[mid])... 阅读全文
posted @ 2015-02-02 15:53 Thereisnospon 阅读(310) 评论(0) 推荐(0)
摘要: 类型定义#include#include#include#define MAX 100/* 稀疏矩阵的十字链表表示: 非零元素节点与表头节点公用一种类型*/typedef struct matrixnode{ int row,col; struct matrixnode *right,*... 阅读全文
posted @ 2015-02-01 22:01 Thereisnospon 阅读(876) 评论(0) 推荐(0)
摘要: 稀疏矩阵#include#include#include#define MAX 100typedef struct{ int data[MAX][MAX]; int m,n;}matrix;//一个普通矩阵typedef int spmatrix[MAX][3];//稀疏矩阵三元组表示法... 阅读全文
posted @ 2015-01-31 22:42 Thereisnospon 阅读(355) 评论(0) 推荐(0)
摘要: 看了半天,还是糊里糊涂,先放这,回过头再看#include#include//求解next[]简化版本void getnext(char p[],int next[]){ int i=0,j=-1,len=strlen(p); next[0]=-1; while(i<len){ ... 阅读全文
posted @ 2015-01-30 22:46 Thereisnospon 阅读(143) 评论(0) 推荐(0)
摘要: #include#includetypedef int type;typedef struct Dnode{ type info; struct Dnode*prior; struct Dnode*next;}dnode;//返回一个建立的双链表头指针,head->next=NUL... 阅读全文
posted @ 2015-01-30 17:43 Thereisnospon 阅读(154) 评论(0) 推荐(0)
摘要: #include#include#includetypedef int type;typedef struct Node{ type info; struct Node*next;}node;//队列声明,保存头指针,尾指针typedef struct{ node *front; ... 阅读全文
posted @ 2015-01-30 17:42 Thereisnospon 阅读(187) 评论(0) 推荐(0)
摘要: #include#includetypedef int type;typedef struct Node{ type info; struct Node*next;}node;//返回一个栈的头指针node*init(){ node*head=(node*)malloc(sizeo... 阅读全文
posted @ 2015-01-30 17:38 Thereisnospon 阅读(114) 评论(0) 推荐(0)
摘要: 链表的基本操作#include#include#includetypedef int type;typedef struct Node{ type info; struct Node *next;}node;//建立一个头节点并将其指针返回node *node_init(){ n... 阅读全文
posted @ 2015-01-30 17:37 Thereisnospon 阅读(115) 评论(0) 推荐(0)
摘要: #include#define MAX 100//定义顺序表的最大值//顺序表的定义typedef struct{ int l[MAX]; int size;//顺序表的长度}sequence_list;//函数功能:顺序表的初始化——置空表//函数参数:指向sequenc_list型变... 阅读全文
posted @ 2015-01-16 17:16 Thereisnospon 阅读(210) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页