Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We have a custom markup language, where each tag has a starting and ending tag. Starting tag may have attributes and values. We can call

We have a custom markup language, where each tag has a starting and ending tag. Starting tag may have attributes and values. We can call an attribute by referencing the tag, followed by a tilde, '~' and the name of the attribute.

The tags may also be nested. for e.g.

//may contain more nested tags

We can access a tag's attribute value: tag1~attribute1 for nested tag: tag1.tag2~attribute-name

It is given a tag starting will have an ending tag. The first line consists of two space separated integers, and . specifies the number of lines in the custom markup language.

Q specifies the number of queries. The following lines consist of either an opening tag with zero or more attributes or a closing tag. There is a space after the tag-name, attribute-name, '=' and value.There is no space after the last value. If there are no attributes there is no space after tag name. queries follow. Each query consists of string that references an attribute in the source program. More formally, each query is of the form: tagi1.tagi2tagin~attribute-name , n1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions