- 11
- 0
- 约1.62万字
- 约 44页
- 2017-06-12 发布于河南
- 举报
(中秋节快乐)离散大家上机第2题(国外英文资料)
(中秋节快乐)离散大家上机第2题(国外英文资料)
The header file
Name of the class. H
/ / define the storage operator stack
The class SeqStack
{
Public:
SeqStack (int size);
Virtual ~ SeqStack ();
Bool Pop (); / / remove the top element of the stack
Void Push (const char item); / / push in the stack
Char Top (); / / return stack top elements
Bool Clear (); / / remove the stack
Boolean IsEmpty () const; / / determines if the stack is empty
Int Size () const; / / the number of elements in the stack
Private:
Int maxSize; / / the maximum capacity of the stack
Int top; / / stack top position
Char * op; / / an array of operators
};
/ / the bool value stack that corresponds to the propositional element in storage
The class IntStack
{
Public:
IntStack (int size);
Virtual ~ IntStack ();
(const int factor); / / push in the stack
Int Top (); / / return stack top elements
Bool changTop (int item); / / change the top value of the stack
Bool Pop (); / / remove the top element of the stack
Bool Clear (); / / remove the stack
Boolean IsEmpty () const; / / determines if the stack is empty
Int Size () const; / / the number of elements in the stack
Private:
Int maxSize; / / the maximum capacity of the stack
Int top; / / stack top position
Int * intFactor; / / an array of operational factors
};
/ /
The class Arry
{
Public:
Arry ();
~ Arry ();
Int, icp (char c) const; / / the priority order of the stack
Int isp (char c); / / the priority order in the stack
Bool whetherOP (char c) const; / / is it an operator
Char compare (char c) const; / / take an operator and compare the top of the stack
Bool getPostfix (); / / processing operator function, which gives the postfix expression
Bool getPropotion (); / / find the single proposition element in the postfix expression
Void BINadd (); / / binary Numbers are added once
Const intnum 1, const intnum 2, const char op; / / calculate
Bool getBool (); / / the bool value of the formula
Bool prin (); / / output postfix expressions
Void continueORend (); / / functio
您可能关注的文档
最近下载
- 汉语言文学本科毕业论文-封建礼教的牺牲者与抗争者—浅析白鹿原田小娥的形象.doc VIP
- 可可西里野生动植物保护协会入会申请.pdf VIP
- 塑料与塑料制品原料与助剂讲义课件.ppt VIP
- 全球化的陷阱.docx VIP
- TCBMF 105-2021 TCWA 203-2021设计技术规范.docx VIP
- 通过连接共定位的夹心测定法.pdf VIP
- 残疾人社会工作教学课件 余艳萍 秦琴-第10章 残疾人小组工作模式及运用.pptx VIP
- 智慧化税费申报与管理(第六版)项目六个人所得税智慧化申报与管理.doc VIP
- 上海地铁人民广场站五一客流应急处置设计论文.pdf VIP
- 【沃尔沃挖机图集】VOLVO液压基础.pdf VIP
原创力文档

文档评论(0)