链表第一二题 #include <stdio.h>#include <stdlib.h>#define false 0#define true 1typedef struct{ int data; struct LNode *next;}LNode,*LinkList;LinkList List_HeadInsertv2(LinkList L){ int x; L=(LNode *)malloc(sizeof(LNode)); L
判断栈的操作是否合法 P66第三题#include <stdio.h>#include <stdlib.h>#define true 1#define false 0_Bool Judge(char str[],int n){ int k=0,t=0; for(int i=0;i<n;i++) { switch(str[i]) { case 'I': k++;
实现HS火车按序输出 #include <stdlib.h>#include <stdio.h>#define MaxSize 50#define true 1#define false 0typedef struct{ char data[MaxSize]; int top;}SqStack;void IninStack(SqStack *S){ S->top=-1;}_Bool StackEmpty(SqStack *S){ if(S
用栈实现递归 #include <stdio.h>#include <stdlib.h>#define MaxSize 50double p(int n,double x){ struct stack { int no; double val; }st[MaxSize]; int top=-1,i; double fv1=1,fv2=2*x; for(i=n;i>=2;i--) {
C语言利用栈实现括号匹配 C语言利用栈实现括号匹配#include <stdlib.h>#include <stdio.h>#define MaxSize 50#define true 1#define false 0typedef struct{ char data[MaxSize]; int top;}SqStack;void IninStack(SqStack *S){ S->top=-1;}_Bool StackEmpty(SqStack *