Knowledge finishing the preliminary round

1. \ (--128 \) complement is \ (10000000 \) , \ (- 1 \) complement is \ (11111111 \) .

2. belong to TCP congestion control algorithms: slow start, congestion avoidance, fast retransmit.

3. At the same lookup \ (2N \) maximum and minimum values of the number, is the minimum number of comparisons \ (-2 with 3N \) ;

Comparing the two numbers before large maximum value, the minimum value is small, a later comparison spent \ (2 * (n-1 ) \) number, compared with the maximum large compare each two small comparison with the minimum, \ (. 3 * (. 1-n-) \) comparisons were \ (3 * (n - 1 ) + 1 = 3n-2 \) compare times.

4. constituted by four different points simple undirected graph is the number of \ (38 \) . 4 differs from FIG undirected simple configuration, up to \ (4 * (4-1) / 2 = 6 \) sides, a minimum of \ (4-1 = 3 \) sides (trees), but note , not all of the edges are optionally three conditions are satisfied,

There is a case of three points forming a triangle and a point in isolation, this total \ (4 \) species so \ (ans = C (6,3) -4 + C (6,4) + C (6, . 5) + C (6,6) = 38 is \) .

The transfer postfix infix expression:

1) If you have a number, we will direct its output.

2) If you encounter operator, then we will put it onto the stack, we encountered left parenthesis also be placed on the stack.

3) If you encounter a right parenthesis, then pop the stack elements, the pop-up operator output until it encounters a left parenthesis so far. Note that the left parenthesis is not only the pop-up output.

4) If you experience any other operators, such as ( "+", "*", "(") and the like, pop-up element from the stack hard against the lower priority element (or stack is empty) found. after the case of pop these elements, it will encounter operator pushed onto the stack. it is important to note that only in the face ")" we only pop-up "(" otherwise we will not pop-up "( . "

Priority of multiplication and division> Modified> left parenthesis

5) If we read the end of the input, then pop the stack of all the elements in turn.

Guess you like

Origin www.cnblogs.com/lihan123/p/11690259.html