answersLogoWhite

0


Best Answer

{ indicates the start point of main body.

} indicates the end point of main body or program.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you understand by the left and right parenthesis ie and used in the main method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Program to count number of leaf node in binary tree in c plus plus?

Add the following recursive method to your binary tree's node class: size_t Node::count_leaves() { if (!left && !right) return 1; // this node is a leaf size_t count = 0; if (left) count += left-count_leaves(); // count leaves on left if (right) count += right-leaves(); // count leaves on right; return count; // return total leaves. } To count the leaves of the entire tree, call the method on the root node of the tree. To count the leaves of a subtree, call the method on the root node of the subtree.


How to write a function to reverse an array without using square brackets in the function?

void reverse (char* str) { char *left, *right, temp; left = right = str; while (*right) ++right; --right; while (left < right) { temp = *left; *left = *right; *right = temp; ++left; --right; } }


How do you convert postfix expression to prefix expression using c plus plus?

Let Q be an arithmetic expression written in infix notation. Besides operands and operators, Q may also contain left and right parentheses. We assume that the operators in Q consist only of exponentiations (↑), multiplications (*), divisions (/), additions (+) and subtractions (-), and that they have the usual three levels of precedence as given above. We also assume that operators on the same level, including exponentiations, are performed from left to right unless otherwise indicated by parentheses. (This is not standard, since expressions may contain unary operators and some languages perform the exponentiations from right to left. However, these assumptions simplify our algorithm.) The following algorithm transforms the infix expression Q into its equivalent postfix expression P. The algorithm uses a stack to temporarily hold operators and left parentheses. The postfix expression P will be constructed from left to right using the operands from Q and the operators, which are removed from STACK. We begin by pushing a left parenthesis onto STACK and adding a right parenthesis at the end of Q. The algorithm is completed when STACK is empty. 69 Algorithm: POLISH(Q, P) Suppose Q is an arithmetic expression written in infix notation. This algorithm finds the equivalent postfix expression P. 1. Push "(" onto STACK, and add ")" to the end of Q. 2. Scan Q from left to right and repeat Steps 3 to 6 for each element of Q until the STACK is empty: 3. If an operand is encountered, add it to P. 4. If a left parenthesis is encountered, push it onto STACK. 5. If an operator ⊗ is encountered, then: (a) Repeatedly pop from STACK and add to P each operator (on the top of STACK) which has the same precedence as or higher precedence than ⊗. (b) Add ⊗ to STACK. [End of If structure.] 6. If a right parenthesis is encountered, then: (a) Repeatedly pop from STACK and add to P each operator (on the top of STACK) until a left parenthesis is encountered. (b) Remove the left parenthesis. [Do not add the left parenthesis to P.] [End of If structure.] [End of Step 2 loop.] 7. Exit. The terminology sometimes used for Step 5 is that ⊗ will "sink" to its own level. . 70 EXAMPLE Consider the following arithmetic infix expression Q: Q: A+(B*C- (D/E↑F)*G)*H We simulate the previous algorithm to transform Q into its equivalent postfix expression P. First we push "(" onto STACK, and then we add ")" to the end of Q to obtain: A + ( B * C - ( D / E ↑ F ) * G ) * H ) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13)(14) (15) (16)(17) (18)(19) (20) The elements of Q have now been labeled from left to right for easy reference. Table below shows the status of STACK and of the string P as each element of Q is scanned. Observe that (1) Each operand is simply added to P and does not change STACK. (2) The subtraction operator (-) in row 7 sends * from STACK to P before it (-) is pushed onto STACK. (3) The right parenthesis in row 14 sends j and then I from STACK to P, and then removes the left parenthesis from the top of STACK. (4) The right parenthesis in row 20 sends * and then + from STACK to P, and then removes-the left parenthesis from the top of STACK. After Step 20 is executed, the STACK is empty and P: A B C * D E F ↑ / G * - H * + 71 which is the required postfix equivalent of Q.


What are two types of alingnment that can be applied on a paragraph in HTML?

You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.You can left align them, center them and right align them.


What is right shift and left shift?

left and right pinky

Related questions

What do you understand by the left and right parenthesis in main method in C programming?

I understand they have the same meaning as they do for any function in C; to separate the function name from its arguments.


What is half a parenthesis called?

parenthesis = singular form, i.e., ( OR ) parentheses = plural form, i.e., ( AND ) The singular forms are generally referred to as: open or left parenthesis = ( close or right parenthesis = ) As for the top or bottom half of one parenthesis? I have no idea.


What do the bacteria represent in the food web?

Function f left parenthesis x right parenthesis represents the population of bacteria x hours after 9 a.m. What does f left parenthesis 2 right parenthesis minus f left parenthesis 1 right parenthesis represent?


What are the fundamental rules af arithmetic?

First executed is ( ) parenthesis Exponents Multiplication and division (left to right) Addition and subtraction (left to right)


What is the order of math operations?

(You might remember this as "Please excuse my dear Aunt Sally.")1Parentheses (or Brackets)ExponentsMultiplication and Division left to rightAddition and Subtraction left to right


What is the first operation in math?

it goes parenthesis exponents, multiply and divide from left to right then add and subtract from left to right remember it by saying the word PEMDAS


Does Iron in well water turn aluminum pot dark?

left parenthesis 8 minus 0.02 right parenthesis squared(8−0.02)2divided by÷44plus+8.38.3times×0.50.5


How can you force Excel to compute part of a formula first?

You could try putting that part in parenthesis. In algebra, formula parts in parenthesis are worked separately and take precedence over what is no in parenthesis. Things are usually worked left to right, and multiplication or division before addition or subtraction.


Rules in operations in algebraic expression?

Parenthesis, Exponents, Multiplication or Division(whichever come first from left to right*), Addition or Subtraction *


How do you simplify an equation with parenthesis?

Use PEMDAS. P is for Parentheses. E is for exponents. M is for Multiplication. D is for Division. A is for Addition. And S is for Subtraction. Multiply and divide left to right. Add and subtract left to right. But do all the steps in the word PEMDAS from left to right.


What is ! called?

what is called a hyphen


What four-steps should be used in evaluating expressions Can these steps be skipped or rearranged?

You should do everything in the parenthesis. Then you do the exponents. Then you multiply and divide from left to right. Then finish with addition and subtraction doing left to right. You cannot do these out of order.