Title: ???????,(???????(JIS))???????????????
1?????????? (1-7??)
21.?????????????????( )?????.
????????????????? ??????????????.
(????)?????????????, ????????????.
(????)??????????????. (????)???????????.
(???)????????,??????????. (???)?????????????,?
?????.
32.??????????????( )????,??????.
???????,(???????(JIS))??????????????? ????????????
????????(???????)???.
4?????????????????????(????), ??????????????,??????
?????? ???????????(????)???. ?????,??????????????
? ??????????(?????), 1??????????????????(?????)???
. ??,?????????????,???????????, ??????????????(
????)???. ???????????? ??????????????? (??????(DO
WHILE?))?, ???????????????????????? ????(??????(R
EPEAT UNTIL?))???.
5?????0????????TANGO???. n?????TANGO(1)??TANGO(n)??
????. ???,n??????TANGO(1)???????, TANGO(1)??TANGO(
n-1)??????1?????????? ??????????????.
?????????????????.
??1
??
TANGO (n)?TANGO (0)
???
i n-1 ,-1, 0
???
??
6???TANGO(n)?TANGO(0)????, TANGO(n)?TANGO(0)???????
. TANGO(1)??TANGO(n-1)???? ??1??????????, ???????
?TANGO(n-1)?TANGO(n), TANGO(n-2)?TANGO(n-1),??? ??
?,TANGO(0)?TANGO(1) ???????????. i?????n-1?,
0?????1????????????, ?????TANGO(i)?TANGO(i1)???
. ????
73.??????????????( )?????.
?????,????(????)?????????????????, ???????????. (?
?????)??????????????? (???)??????. (??????)????
????(?????)????????, ??????????????????????.
????
????
????
????
???
???
???
????????
????
8?????????????3????????.
??????
??????
?????
9?????????????????????????. (???)????????,???????
????? ??????????????. ????????,??????????????????
??????????. (???)?????????????????????, ????????
????,???????????. (???)????????,????????????????
??, ????????????????????????, ???????????????????
??????????????????????????2????. ????????,????????
???????, ????????????. (???)????????,???????????
???????????, ????????????????????. ?????????,?????
?????????????.
104.????????????????????( )?????.
??????,?????????(???)???? ???????(????)???????????
???. ?????????????? ?????????????????? (???????)??
??????????. ???????,??????????????????? (?????????
)???,?????? ??????1,?????-1??.
???3
PUSH
POP
???3
??????
???2
???1
11??????,?????????(?????)????????????(????)????????.
1
2
3
??????
????1
????2
(??????????????????????)
125.???2??????????( )?????.
?????????????????????,(??)???. ??????????(????)???
, ??????(???????), ??????(??)?????)???. ??
?????(???,??????)???????(?????)???.
2?????????????????????????(?2????)???. ??????2???
,????????????????????, ??????????????. ???????????
?????????????? ????????????????????. ??2??????????
??????????.
136.????????????????( )????,??????.
???????,??????????, ??????????????? ?????????. ??
???(???????)???, ???????????(??????)???. ?????????
???? ??????????. ?????????????????, ????????????
???????????????? ????????,?????????????. ????????
?????????????, ????????????.
14????????????, ?????????????????????. ???(???)???.
????????,?????????????(????), ????????????????(???
??)???. ????????????, ?????????????????????, ?????
?(??????)?, ????????????????? (??????????)???.
15??2 ??????????????????, ???????????. ?
?????????????????????. ? ???????????,????????????
??. ? ????????????,?????????. ?
?????????????????,???????????. ????
167.?????????????( )?????.
????????????, ???????????????? (????????????)
???, ?????????????? (????????????)???. ??????
?,?????????????, ????2???????????????. ?????n????,
?????(? n(n-1)/2 )????. ?????,?????? (??????)???
??????, ???????( ? )????,???2?????. ??????????????
?. ?????n???,?????(? n(n-1)/2 )????.
17?????
3
2
4
1
????
40 30 10 20
??X
40 30 10 20
30 10 20 40
30 40 10 20
10 30 20 40
30 10 40 20
10 20 30 40
?????
10 20 30 40
??
18???
3
2
4
1
????
40 30 10 20
??X
40 30 10 20
10 40 30 20
30 40 10 20
10 30 40 20
10 40 30 20
10 20 40 30
?????
10 20 30 40
??
19????,(????)?????????? (??? )??????????????????. (?
????)??(?2???)??????. ( ? )??,(?????)????????????
????. ???n?????????????????? ???????(?n)????, ????
???,(?n/2)???. ???????????????????????(???)???.
( ? )??,?????(?????)??????, ???????????????,??????
??????. ???,??????????,??????( ?
)????, ???????????????????????????????. ?????n????
,???????(?log2n1)?, ???????(?log2n)????.
20?????
3
2
4
1
????
40 30 10 20
??X
1
2
3
(??)
???????????????????????????. ??????,????????????.
10
?????
???????,???????????. ???????????.
212????
?????
3
5
6
7
8
3
2
4
1
????
1
3
5
6
8
13
11
10
??X
??
?
3
3
?
?????? ??????
3
?
???2??????, ??????????????????????. ??????????????
????????.
3
?
?????????,??.
22???? ??
??1
PUSH1
PUSH5
5
1
1
235
POP
PUSH7
5
7
1
1
24PUSH6
PUSH4
4
6
6
7
7
1
1
254
6
POP
POP
4
6
6
7
7
1
1
26PUSH3
3
????
7
1
27??2
???? p.60
????
??3
????
???? p.6365
??4
????
???? p.7172
??5
????
???? p.66