摘要: 设字符串仅由圆括号“(”和“)”,方括号“[”和“]”,花括号“{”和“}”组成,利用链栈的操作编写一个检查括号是否正确配对的算法:int Matcher(LstackTP *ls)。例如[{{()}[ ]}(){[ ]}]是正确的,而{({()[ ]})}])}则不正确。设链栈定义如下:(6分) typedef struct node { char data; struct node * next; } LStackTp;//Stack.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h" 阅读全文
posted @ 2011-09-27 08:24 稻草人.cn 阅读(438) 评论(0) 推荐(0) 编辑