Find Jobs
Hire Freelancers

stacks and queues

$30-60 USD

Closed
Posted over 20 years ago

$30-60 USD

Paid on delivery
Q1. Write a program that outputs an appropriate message of grouping sybols, such as parentheses and braces, if an arithmetic expression matches. For example, the expression {25 + ( 3 - 6 ) * 8 contains matching grouping symbols. Q2. Write a program that uses a stack(not recursion) to convert a decimal number into an equivalent binary number. Q3. Write a program that converts an infix expression into an equivalent postfix expression. The rules are as follows: Suppose **infx** represents the infx expression and **pfx** represents the postfix expression. a. Initialize **pfx** to an empty expression and also initialize the stack. b. Get the next symbol, **sym**, from **infx**. b1. If **sym** is an operand, append **sym** to **pfx**. b2. If **sym** is (, push **sym**, into the stack. b3. If **sym** is ), pop and append all the symbols from the stack until the most recent left parentheses. Pop and discard the left parentheses. b4. If sym is an operator: b4.1. Pop and append all the operators from the stack to **pfx** that are above the most recent left parenteses and have precedence greater than or equal to sym. b4.2. Push **sym** into the stack. c. After processing **infx**, some operators might be left in the stack. Pop and append to **pfx** everything from the stack. ## Deliverables Q 3(cont). In this problem(Q3), you will consider the following (binary arithmetic operators: + - * and /. You may assume that the expressions you will process are error free. 1. **getInfix**: store the infx expression. 2. **showInfix**: Outputs the infx expression. 3. **showPostfix**: Outputs the postfix expression. 4. **convertToPostfix**: Converts the infix expression into a postfix expression. The resulting postfix expression is stored in **postfixString**. [login to view URL] the precedence between two operators. If the first operator is of higher or equal precedence that the second operatorm it returns the value *true*; otherwise, it returns the value *false*. Include the constructors and destructors for automatic initialization and dynamic nemory decallocation. Test your program on these expressions: 1. A + B - C 2. (A + B ) * C; 3. (A + B) * C; 4. A + ((B + C) * ( E - F) - G) / (H - I); 5. A + B * ( C + D ) - E / F * G + H; For each expression, youe answer must be in the following form: Infix Expression: A + B - C; Postfix Expression: AB+C- ****Actually Q 1 and 2 have mostly been done. Q 3 is really the problem that I got stuck with. Therefore, if someone can finish them all as soon as possible or just Q 3 it will be fine w/ me.** 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site). ## Platform All problems should be written only with C++.
Project ID: 2978237

About the project

4 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
4 freelancers are bidding on average $31 USD for this job
User Avatar
See private message.
$5.95 USD in 1 day
4.9 (22 reviews)
4.8
4.8
User Avatar
See private message.
$24.65 USD in 1 day
4.9 (34 reviews)
4.0
4.0
User Avatar
See private message.
$50.15 USD in 1 day
4.9 (18 reviews)
3.9
3.9
User Avatar
See private message.
$42.50 USD in 1 day
5.0 (2 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
5.0
13
Member since Sep 21, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.