Question
HTML is the language in which most websites are written. HTML is used to create pages and make them functional. Tags and attributes are the
HTML is the language in which most websites are written. HTML is used to create pages and make them functional. Tags and attributes are the basis of HTML. Tags are used to mark up the start of an HTML element and they are usually enclosed in angle brackets. An example of a tag is:
. Most tags must be opened and closed
in order to function. Write a program that will extract all the tags and determine any unmatched tag.
My Books
Green Eggs and Ham
Great eggs and even greater ham
Don Quixote
Gallant imitator of protagonists worldwide.
The Stand
Everyone loves a good apocalypse story.
The input to the program will be html code like the above reading from a file and the output will be the number of matched tags including the tag which is unmatched. For example, if
we provide the above html code via text file, the output of the program will be the following:
Total number of tags: 11 Number of matched tags: 9 Number of unmatched tags: 2 Unmatched tags:
,
You need to use Queue and stack data structure to implement this problem.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started