You can Select one or more In which applications below are s

You can Select one or more:

In which applications below are stacks a suitable data structure? Select one or more: Matching parentheses and grouping symbols in arithmetic expressions Matching HTML tags in an HTML document Keeping track of people waiting in line to get on an amusement park ride where people enter at the rear of the line and get on the ride from the front of the line

Solution

Answer: stack data structure is used in below two applications:

a) Matching parentheses and grouping symbols in arithmetic expressions

b) Matching Html tags in an HTML documents

Explanation:

Stack is a LIFO working data structure is best use in expression evaluation and syntax parsing. Most compiler uses stack for expression evaluation and syntax parsing.

Therefore stack is suitable for matching parentheses and grouping symbols in arithmetic expressions and matching HTML tags in an HTML document.

In option c a First in first out method is used therefore stack is not used. Queue is used in option c.

You can Select one or more: In which applications below are stacks a suitable data structure? Select one or more: Matching parentheses and grouping symbols in a

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site