Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task2 In this system, there is an option for the finance department to do some calculations related to the event, they will input their equations

Task2 In this system, there is an option for the finance department to do some calculations related to the event, they will input their equations through expressions as the following expression example:

image text in transcribed

These expressions are in the form of String data type, in this task you will be responsible to check whether the parentheses in the expression are balanced or not. The Expression is of the form of a string comprising of constants, variables, operators, and parentheses, parenthesis include curly brackets, square brackets, and parentheses, as following

image text in transcribed

You should think of a way to check if parentheses in an expression are balanced or not. Balanced parentheses are that corresponding to each opening parenthesis we should have a closing counterpart in correct order. The following are examples of some expressions:

image text in transcribed

Whats inside parentheses does not matter you should not check for correctness of anything that is inside a parenthesis, so in the expression any character other than opening and closing parenthesis can be ignored. To solve this problem easily, you need to choose a data structure that you know to use it in your solution.

a. you should demonstrate how you will solve this problem by writing a Pseudocode for a function that takes a string expression and returns whether this expression balanced or not. (Report)

b. You need to specify the ADT of the data structure you used in Task2 a. (Report)

c. Interpret what is a trade-off when specifying this data structure if it exists. (Report)

(A + B) / 2 [J [3 () Balanced ? Yes Yes Expression (A + B) {(A+B) +(C+D)} { (x+y)+ (2) [ 2 +3] + (A)] { a+z) + NO No No

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

what command is used to change default permissions

Answered: 1 week ago