摘要: # infix [] -> 中缀表达式 ; s2[] -> 栈的顺序表 ; top2 -> 栈顶指针 void infixToPostFix(char infix[ ], char s2[ ], int &top2) { char s1[maxSize]; #s1 辅助栈 int top1 = -1 阅读全文
posted @ 2021-02-21 16:16 当时不杂 阅读(34) 评论(0) 推荐(0) 编辑
摘要: int getPriority(char op) #判断运算符优先级 { if(op == '+' || op == '-') return 0; else return 1; } int calSub(float opand1, char op, float opand2, float &resu 阅读全文
posted @ 2021-02-21 16:14 当时不杂 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 一双链表非空,有head指针指出,结点结构为{llink, data, rlink},请设计一个将节点数据域data值最大的那个结点(最大值结点只有一个)移动到链表最前边的算法,要求不得申请新节点空间 void maxFirst(DLNode *head) { DLNode *p = head->r 阅读全文
posted @ 2021-02-21 16:07 当时不杂 阅读(106) 评论(0) 推荐(0) 编辑