You are on page 1of 5

1

27 2016
:

( )
: (5)

1.
1-5 , , , ,
, .
1.
2.

2.


.

.

3.

,
,
_.

4.

< .

5.



.
10


( ) table n.

//table,n//
i ..(1).. ..(2)..
j ..(3).. ..(4).. ..(5)..
table [j-1] > table [..(6)..]
table [j-1], table [j]
_
_
_
//table//

6

3.

[7] :
2

12

15

17

1 5

22

2
:
low 1
high 7
found
low high found=
mid (low+high) DIV 2
[mid]
[mid] < 22
low mid+1
_ [mid] > 22
high mid-1

found
_
_
.
9
4.

:
5

10

12

[4]
:
1. [[1] [3]] [5]
2. [[4] [5]] [8]
3. [[3]] [1]
4. [[3] + [4] [5]] [1] + [2]
8
5.

:
i 1 100
i MOD 2=0
i
_

_
(
).
) , ( 3)
) , ( 4)
7

2 5

3

1.


. , ,
:

1 1 1 1

= 4 + + ...
1 3 5 7


5 .

1 5,
, , , , ,
, .
10
2.

1.
2.
3.
4.
5.
6.

x 15
1
x<18
x x +
x mod 3=0
+ 2

+ 1

_

7.


, ,
( ).

3 5

x
15

x<18

x mod 3=0

10

1-50

580

51-100

520

101-200

470

200

440

:
1.

.
2

2.

(),
.
4

3.

, ,
,
.
, .
, .
8

4.

.
6

4 5

5

, 150
,
.
, :
1.

.
2

2.

1.000.000
1.000.000 .
2

3.

, ,
.
8

4.

,
, .
, : .
, 0.
8
(:
).

1.

2.

3.
4.
5.
6.

( )
.
- .
-
.

.

.
.

.

. ,
, , .
.

(3)

.
: 10.30 ..
K

5 5