stacks and queues

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**.

[url removed, login to view] 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++.

Habilidades: Programação C, Programação C#, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: uses of binary, stacks and stacks, stack programming, software stacks, software for dynamic programming, recursion programming, recursion problems in c, recursion problem, recursion in programming, programming symbols, programming symbol, programming recursion, programming operators, programming operator, programming expression, problems on recursion in c, expression in c programming, example of dynamic programming, dynamic programming software, dynamic programming problems, dynamic programming problem, dynamic programming explained, dynamic programming example problems, dynamic programming example, dynamic programming code

Acerca do Empregador:
( 13 comentários ) United States

ID do Projeto: #2978237

4 freelancers estão ofertando em média $31 para este trabalho


See private message.

$5.95 USD em 1 dia
(22 Comentários)

See private message.

$24.65 USD em 1 dia
(34 Comentários)

See private message.

$50.15 USD em 1 dia
(18 Comentários)

See private message.

$42.5 USD em 1 dia
(2 Comentários)