Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using Structures c++ and without using build-in function pls A stack Cost: 3 Solved: 0 Memory limit: 256 Mb Time limit: 1000 ms Input file:

image text in transcribed

using Structures c++ and without using build-in function pls

A stack Cost: 3 Solved: 0 Memory limit: 256 Mb Time limit: 1000 ms Input file: stdin Output file: stdout Task: You are given a string s consisting of different opening and closing brackets (),[), >, {}. You have to check whether or not the string a regular brackets sequence. A sequence is considered regular if the next rules are followed: 1) An empty sequence is a regular sequence. 2) If s is a regular sequence, then (s), [s], , {s} are regular sequences. 3) If A and B are regular sequences, then AB is a regular sequence. Input: The string s consisting of different brackets. Output: Write 1 if the sequence is regular and O if not. Example: Input Output ( 0 [{}() 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions