Consider strings constructed using only the following characters (, ), [, and ]. Character ( matches with
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider strings constructed using only the following characters ‘(‘, ‘)’, ‘[’, and ‘]’. Character ‘(’ matches with only ‘)’ and ‘[’ matches with only ‘]’. A string comprising of these characters is complete if every character is followed by its matching character or a substring that is complete followed by its matching character. For example “()”, “[]”, “([])”, “[]([]())” are all examples of complete strings, while “([)]” and “[][(])” are examples of incomplete strings. Write program using character stack which accepts such strings as input and prints “Complete” or “Incomplete”.
Related Book For
Computer Networking A Top-Down Approach
ISBN: 978-0136079675
5th edition
Authors: James F. Kurose, Keith W. Ross
Posted Date: