Preliminary review

Preliminary review

1. Classification language

1. compiled language

Since the fast program execution speed, under the same conditions of low system requirements, which are used so as to develop embodiment when the operating system, large applications, database systems: C / C ++ , Pascal / Object Pascal (Delphi), VB , etc.

2. interpretive language

Some web scripts, server script and assist in developing such an interface speed of less demanding, there are certain requirements for compatibility between different systems platforms are usually interpreted language program

例:Java、JavaScript、VBScript、Perl、Python、MATLAB等

It is generally interpreted language with the Script

2. History

1. China Computer Federation in 1984 founded the National Youth Computer Programming Contest .

3. Miscellaneous

1. The calculated binary decimal

Decimal Binary turn: binary integer calculations and similar, from a representative of a few sequentially back 2 -1 2 -2 2 . 3 , sequentially to points

Binary Decimal: sequentially adding principle by two or rounded position

2. preamble, in sequence, after expression

1. Calculation

Preamble: right to left into the stack, if a number directly into the stack, if two operators stack number is taken, the corresponding calculation

In order: what we usually see expression

After the sequence: from left to right into the stack, the same treatment with other preamble

Forwarding the preamble sequence

1, the inverting input string, such as "2 * 3 / (2-1) + 3 (4-1)" after the inverted ") 1-4 ( 3+) 1-2 (/ 3 * 2",
2, taken from a character string next
  2.1. If the operand is directly output
  2.2. If ")," pushed onto the stack
  2.3. If the operator but not "(", ")", are constantly the following processing cycle
    2.3.1. If the stack is empty, then the operator into the stack, the end of this step
    2.3.2. If the stack is ")", then the operator into the stack, the end of this step
    2.3.2. If this operator stack with the same or higher priority, this operator into the stack, the end of this step
    2.3.4. otherwise, the stack operator continuously output until one of three conditions as described above, and then this operator push
  2.4, if it is "(", the operator continuously output the stack, until she met ")" So far, the ")" of the stack and discarded
3, if there are more strings, go to step 2
. 4 , not an unprocessed string, and outputs the remaining elements in the stack
5, to give the final result character string is reversed again

In subsequent transfer sequence

Scan from left to right, met operand, the direct output; when faced with operators (+, -, *) and left parentheses, popped from the stack and written to the output element until it finds a priority (priority + the lowest level, the highest priority left parenthesis) until the lower elements (note that this does not pop up lower priority elements), but with one exception, that is, except when dealing with a right parenthesis, otherwise we will not pop up from the stack left parenthesis, when the pop-up element from the stack is completed, when the operator is then pushed onto the stack; when encountered in the right bracket, the stack will be written to the output element and the pop-up until it encounters a left parenthesis, but the left parenthesis just been ejected, and not written to the output. If the end of the scan from left to right, there are elements in the stack, then the stack elements of pop and written to the output until the stack is empty

For example: sequence expression (23 + 34 45 / (5 + 6 + 7)) is converted to the sequence expression 3445 23 5 + 6 + 7 / +

Guess you like

Origin www.cnblogs.com/Akaina/p/11590466.html