摘要: //共享栈#include<stdio.h> #define MaxSize 5#define ElemType int typedef struct {ElemType data[MaxSize];int top1;int top2;}SqStack; //初始化void initStack(Sq 阅读全文
posted @ 2022-07-15 23:09 天天掉头发 阅读(61) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #define MaxSize 5#define ElemType int typedef struct {ElemType data[MaxSize];int top;}SqStack; //初始化void initStack(SqStack *S){ S->t 阅读全文
posted @ 2022-07-15 23:05 天天掉头发 阅读(32) 评论(0) 推荐(0) 编辑
摘要: //循环双链表#include<stdio.h>#include<stdlib.h>#define ElemType int typedef struct Node{ElemType data;struct Node *prior,*next;}Node; Node *createHead(){ N 阅读全文
posted @ 2022-07-15 23:01 天天掉头发 阅读(28) 评论(0) 推荐(0) 编辑
摘要: //双链表#include<stdio.h>#include<stdlib.h>#define ElemType int typedef struct Node{ElemType data;struct Node *prior,*next;//双链表 有头尾两个指针}Node; //创造头节点Nod 阅读全文
posted @ 2022-07-15 22:58 天天掉头发 阅读(41) 评论(0) 推荐(0) 编辑
摘要: //头插 尾插 删除 查询 单链表#include<stdio.h>#include<stdlib.h> #define ElemType int typedef struct a{ElemType data;struct a *next;}Node; //创造头节点,本人比较喜欢有头结点的,方便N 阅读全文
posted @ 2022-07-15 22:49 天天掉头发 阅读(22) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h> #define initSize 10 //定义初始大小#define ElemType int typedef struct List{int length,MaxSize;//现在定义的是动态的顺序表,所以设置一个MaxSi 阅读全文
posted @ 2022-07-15 21:23 天天掉头发 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #define MaxSize 10 //宏定义 替换效果 MaxSize替换为50#define ElemType int //ElemType 替换为 int typedef struct List{int length =10; //可以不设置=10 为了区 阅读全文
posted @ 2022-07-15 21:07 天天掉头发 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 这类问题难点在于对函数的转化后的定义域不够清晰, (1)我们可以将函数的图像画出来。 (2)然后将函数写成第一行的那种形式。 (3)根据式子和图像一一对应 例如: 值得注意的是,有些地方它是有两个不同式子组成的,那么这些地方呢就需要分别带入 阅读全文
posted @ 2022-05-04 15:10 天天掉头发 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 通过代码: #include<iostream>using namespace std; int main(){ long long *a,*b,*c; int n; cin>>n; a=new long long [n]; b=new long long [n]; c=new long long 阅读全文
posted @ 2021-10-10 20:22 天天掉头发 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 没什么好讲的,多写几项规律就出来了:f(n)=2*(f(n-1)+f(n-2)) 接下来就是递归加打表 #include<iostream>using namespace std; #define N 40long long a[40] = { 0,3,8,22, }; long long sum( 阅读全文
posted @ 2020-09-01 15:13 天天掉头发 阅读(116) 评论(0) 推荐(0) 编辑
返回顶端