当前位置: 首页 > news >正文

网站开发税目编码ssh架构jsp网站开发

网站开发税目编码,ssh架构jsp网站开发,做淘宝联盟必须要有网站吗,企业门户网站特征【0】表ADT1#xff09;intro#xff1a;我们把 形如 A1, A2, A3, ..., An 的结构称为表#xff1b;2#xff09;表的实现#xff1a; 数组#xff08;循环数组#xff09; 或 链表 或 双链表 或 循环链表实现#xff1b;3#xff09;表的插入#xff0c;删除操作可以…【0】表ADT1intro我们把 形如 A1, A2, A3, ..., An 的结构称为表2表的实现 数组循环数组 或 链表 或 双链表 或 循环链表实现3表的插入删除操作可以在任意位置上进行【1】栈基于表1intro栈是限制插入和删除只能在一个位置上进行的的表2栈的实现 数组实现 或 链表实现3栈的应用应用荔枝1检验代码的平衡符号每一个 括号圆括号中括号花括号 都要一一对应Attentionstack.h如下#include stdio.h #include malloc.h#define ElementType char #define ERROR(str) printf(str)struct Stack; typedef struct Stack *Stack;struct Stack {int size;ElementType* head;int top; };int isFull(Stack s); int isEmpty(Stack s); Stack initStack(int size); void push(Stack s, ElementType c); void pop(Stack s, ElementType *e);int isFull(Stack s) {return s-size s-top ? 1 : 0; }int isEmpty(Stack s) {return 0 s-top ? 1 : 0; }Stack initStack(int size) {Stack s (Stack)malloc(sizeof(struct Stack));if(sNULL){ERROR(error: failed initStack() for there is no spare space.\n);}else {s-size size;s-top 0;s-head (ElementType*)malloc(sizeof(ElementType) * size);if(s-headNULL){ERROR(error: failed initStack() for there is no spare space.\n);return NULL;}}return s; }void push(Stack s, ElementType c) {if(!isFull(s)){s-head[s-top] c;} else{printf(%s, failed pushing for stack is full.);} }void pop(Stack s, ElementType *e) {if(!isEmpty(s)){*e s-head[--s-top];}else{*e ;printf(%s, failed poping for stack is empty.);} } /prepre code_snippet_id1797122 snippet_file_nameblog_20160731_3_2765700 namecode classcpp#include stack.h// check whether the grammar defined in given file is correct or not. int checkFile(Stack s) {FILE *fp;ElementType c;ElementType popc;fp fopen(D:\\classical_books\\datastructure_alg\\source_code\\chapter3\\review_for_job\\p52_check_balanced_char\\temp.txt, r);// only test for round bracket (), bracket [], brace{}.// do you know the meanings of open brace { and close brace }.while((cgetc(fp)) ! EOF){if(c ( || c [ || c {){push(s, c);}else if(c ) || c ] || c }){pop(s, popc);if(c) popc! (){return 0;}else if(c] popc! [){return 0;}else if(c} popc! {){return 0;}}}return 1; }int main() {Stack s;int result; s initStack(1000);if(sNULL){return -1;}result checkFile(s);printf(%d \n, result);return 0; }应用荔枝2计算后缀表达式的值step1将中缀表达式转为 后缀表达式step2然后求 后缀表达式的值 Attentioninfix2postfix.h 见应用荔枝3#include infix2postfix.h void computeExpr(Stack s, ElementType *postfix, int length) {int i 0;char c;ElementType num1, num2, result;for(;ilength;i){c postfix[i];if(isOperator(c) -1)// c is an operand.{push(s, c-48);}else if(isOperator(c) ! -1) // c is an operator.{pop(s, num1);pop(s, num2); switch(c){case : result num1num2;break;case -: result num1-num2;break;case *: result num1*num2;break;case /: result num1/num2;break;}push(s, result);}}pop(s, result); printf(final computing result is %d \n, result); }int main() {Stack s; ElementType output[255];int length;s initStack(1000);if(sNULL){return -1;}length infix2postfix(s, output); //switch infix into postfix.printChatArray(output, length);// compute postfix expr.free(s);sinitStack(1000);computeExpr(s, output, length);return 0; }应用荔枝3中缀表达式 中缀转后缀表达式 stack.h 同上 infix2postfix.h 如下#include stack.h #include math.hvoid printChatArray(ElementType* array, int size); int isOperator(ElementType c); int checkPriority(int p1, int p2); int infix2postfix(Stack s, ElementType *output);// just print array. void printChatArray(ElementType* array, int size) {int i0;for(;isize; i){putchar(array[i]);}printf(\n\n); }// check whether the char is operator or not. // if true returns priority with array index ,otherwise return -1. int isOperator(ElementType c) { int i 0;char priorities[] {(, , ,-, ,*,/};int size 7;for(; isize; i){if(cpriorities[i]){return i;}}return -1; } // 0 means p1.priority p2.priority // 1 // -1 int checkPriority(int p1, int p2) {if(p1-p21 || p1-p2-1 || p1-p20){return 0;}else if(p1-p21){return 1;}else if(p1-p2 -1){return -1;} }// transmit infix into postfix. // attention for operands not being pushed into stack. int infix2postfix(Stack s, ElementType *output) { ElementType c, popc, topc; int i 0;int p1, p2; printf(%s, input the expr: );while((cgetchar()) ! \n){if(c() // when the char is ( or ){push(s, c);}else if(c)){while(!isEmpty(s) (topcgetTop(s))!(){pop(s, popc);output[i] popc; }if(topc(){pop(s,popc);}} // when the char is ( or ) over.else if(isOperator(c) -1) // c is an operand.{output[i] c;}else if((p1isOperator(c)) ! -1) // c is an operator.{if(isEmpty(s)) // if the stack is empty.{push(s, c);}else // if the stack is not empty.{ while(!isEmpty(s)){topc getTop(s);// after that, check priority between c and topc.p2 isOperator(topc);if(checkPriority(p1,p2) ! 1) // p1.priority p2.priority, then pop operand under p2 into output array.{pop(s, popc);output[i] popc;}else{ break;}} push(s, c);} }}while(!isEmpty(s)) // pop surplus elements into output array.{pop(s, popc);output[i] popc; } return i; }#include infix2postfix.h int main() {Stack s; ElementType output[255];int length;s initStack(1000);if(sNULL){return -1;}length infix2postfix(s, output); //switch infix into postfix.printChatArray(output, length);return 0; }【2】队列基于表1intro队列是插入在一端而删除在另一端的表2队列的实现数组实现 或  循环数组队列实现3循环队列代码如下#include stdio.h #include malloc.h#define ElementType int #define Error(str) printf(\nerror: %s, str)struct Queue; typedef struct Queue* Queue;// 循环队列的数据结构. struct Queue {int capacity;int front;int rear;int size;ElementType* array; };Queue initQueue(int capacity); int isFull(Queue queue); void enQueue(Queue queue, ElementType e); int isEmpty(Queue queue); ElementType deQueue(Queue queue); void printQueue(Queue queue);// init queue wit capacity. Queue initQueue(int capacity) {// allocate memory for queue.Queue queue (Queue)malloc(sizeof(struct Queue)); if(queueNULL){Error(failed initQueue() for out of space.);return NULL; } queue-capacity capacity;queue-front 0;queue-rear 0;queue-size 0;// allocate memory for queue-array.queue-array (ElementType*)malloc(capacity * sizeof(ElementType));if(queue-array NULL){Error(failed initQueue() for out of space.);return NULL;} return queue; }// judge whether the queue is full or not. int isFull(Queue queue) {return queue-size queue-capacity ? 1 : 0; }// 进队列满时不进. void enQueue(Queue queue, ElementType e) { if(isFull(queue)){Error(failed enQueue() for the queue is full.);return ;} queue-array[queue-rear % queue-capacity] e;queue-size; }// judge whether the queue is empty or not. int isEmpty(Queue queue) {return queue-size 0 ? 1 : 0; }// 出队列空时不出. ElementType deQueue(Queue queue) {int temp;if(isEmpty(queue)){Error(failed deQueue() for the queue is empty.);return -1;}temp queue-array[queue-front % queue-capacity];queue-size--;return temp; }// 打印队列 void printQueue(Queue queue) {int i, index;ElementType* array queue-array;printf(\n);for(i0; iqueue-size; i){index (queue-front i) % queue-capacity;printf(%d , array[index]);}printf(\n); }// 打印队列所在数组 void printArray(Queue queue) {int i;printf(\nelements in queue-array from index 0 are as follows: );for(i0; iqueue-size; i){printf(%d , queue-array[i]);}printf(\n); }#include queue.hvoid main() {ElementType array[] {3, 4, 6, 1, 2, 0, 10, 8, 9};Queue queue;int capacity6;int i;queueinitQueue(capacity); // 初始化队列if(queue NULL){return ;}printf(\nlet {3, 4, 6, 1, 2, 0, 10, 8, 9} enter queue.\n);for(i0; i9; i){enQueue(queue, array[i]); // 让元素进队列}printf(\n\nthe elements in queue are as follows: );printQueue(queue);// 让元素出队列deQueue(queue);deQueue(queue);deQueue(queue);enQueue(queue, array[6]);enQueue(queue, array[7]);enQueue(queue, array[8]);printf(\n\nafter 3 dequeue operations and enQueue({10,8,9}) ,the elements in queue are as follows: );printQueue(queue);printArray(queue); }
http://www.zqtcl.cn/news/317697/

相关文章:

  • 黄石网站开发云开发小程序源码
  • 重点实验室网站建设萧山好的做网站的公司
  • 物流网站的建设网站建设优化是什么鬼
  • 门户网站建设项目书页面设计一般用什么软件
  • 安徽城乡建设 厅网站电子商务网站建设需要哪些步骤
  • 网站建设应该懂什么知识青岛模板网站建设
  • 免费cms建站系统有哪些网站设计项目总结
  • 做网站湖州网站后台管理系统如何使用
  • 网站建设报价单-中英文版长春省妇幼网站做四维
  • 注册网站免费网站上传小马后怎么做
  • 我省推行制度推动山西品牌建设整站优化网站
  • 临海手机网站设计网站设计 深圳
  • 网站推广做哪个比较好百度怎么优化排名
  • 做jsp网站时怎么预览wordpress安装不上
  • 网站建设深圳官网怎么制作网站镜像
  • 弹幕网站开发难么招生网站建设的意义
  • 网站空间多大合适软件开发培训机构网课
  • 13个实用平面设计网站网络推广一个月的收入
  • 淮安企业网站制作校园网网络规划与设计方案
  • html完整网站开发自媒体平台账号注册
  • 厦门seo网站网站空间 群集
  • 青岛网站推广方案营销自动化平台
  • 管理信息系统与网站建设有什么区别python版wordpress
  • 济南市建设行政主管部门网站公众号登录入口官网
  • 深圳苏州企业网站建设服务企业做网站需要什么条件
  • 电脑什么网站可以做长图攻略公众号 微网站开发
  • 网站核检单怎么用小皮创建网站
  • 企业网站托管平台有哪些烟台高新区建设局网站
  • 石家庄网站做网站和县网页定制
  • 网站个人备案和企业备案潍坊公司注册网站