int score[5]; - PowerPoint PPT Presentation

About This Presentation
Title:

int score[5];

Description:

Title: 7 Author: yahui Last modified by: ntu Created Date: 8/15/2004 12:31:38 PM Document presentation format: Company – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 31
Provided by: yah109
Category:
Tags: book | int | score | stack

less

Transcript and Presenter's Notes

Title: int score[5];


1
?7? ????
  • 7-1 ??
  • 7-2 ????
  • 7-3 ?????
  • 7-4 ????

2
7-1 ??
  • ????????????,???1??5????????
  • ????
  • int score5
  • ?????????????,????

3
?????
  • ????????????
  • ???? ????????,?????
  • ???????,???????????????,???????????,?????????????
    ???????,?????

4
????
  • ????????5?????????????
  • ????
  • int scores25
  • ?????????????? scores ????????,?????????
    scores ????????,??????????????????

5
?????????
  • ????????????????,??????????,????
  • ??????
  • ?????
  • ????????????????,????????? ?,????,?????

10
6
7-2 ????
  • ?????????????????
  • ?????????,?????????
  • ???????? front,???????????????
  • ????????

7
????
  • ??C?????,?????????????? ??,??????
  • ???????????????????
  • ???????
  • ????????? ??,? ?front.data???????? data????
  • ????????? -gt ,??front-gtdata?
  • ???
  • ??? null
  • ?????????????

8
??????(?)
  • ?????????????????
  • ?? insert ????

9
??insert????
  • ?? ?insert(front, 7) ????
  • ?? malloc??????????,??????? temp?????
  • ??? 7????? temp??? data
  • ??? temp??? next ?? p??????,???????????
  • ??? p(??? front)?????????
  • ?????????????

10
?????????
  • ?????????????????
  • ?????? malloc?????????????,???????????????
  • ????????
  • ?????????????,????????????,????????????

11
??????(?)
  • ?????????????????????????
  • ?? print_linked_list ????

12
??????(?)
  • ?????? p????????????,??????? q ????????????
  • ?? changehead ????

13
7-3 ?????
  • ??
  • ????
  • ????
  • ????
  • ??????1??????????,???????5???????????
  • ????,????????????5??,??????1???

14
???????
  • ???????????????????
  • int stack10
  • ?????? top,???????????
  • int top -1
  • ???????????? push
  • ????????????? pop

15
??
  • ??
  • ????
  • ????
  • ????
  • ?????????1?????????,?????,?????2?????
  • ?????,???????????????1??,???2???

16
???????
  • ???????????????????
  • int queue10
  • ?????? front? rear,??????????????????
  • int front -1 rear -1
  • ???????????? put
  • ????????????? get

17
????
  • ???????????????,???????????,???????
  • ??????
  • int queue6 front 0 rear 0
  • ????? ,???????????????
  • rear (rear 1)6
  • ????? ,????????????
  • front (front 1)6
  • ?????????
  • front rear
  • ?????????
  • (rear1)6 front

18
???????
19
?????????
20
7-4 ????
  • ???(Node)??(Edge)???,???
  • ?????????
  • ????(External node)??????,???????,??? E? F?
    H?????
  • ????(Internal node)???????,??? C? I?
    G?????
  • ???(Root node)????????,??? L????

21
????
  • ??????????
  • ??????(Loop),???????????????,????????
  • ?????????????,?? E????? I??,???????
    G,????????????,??? J????? C??,????????
    K??? L?

22
??????
  • ????
  • ???????????????????
  • ????
  • ??????,????????
  • ????
  • ?????????????????????????(?????)?????????????????
  • ????
  • ??????????????????????????(?????)????????????????
    ?

23
???
  • ?????????2????(???????,????1?)
  • ??????????
  • ?????,??????,???????????,??????????

24
????
  • ????????????
  • ??????????????????
  • ????????????
  • ??????????????????
  • ????????,????????

25
?????
  • ??????????????
  • ?????(????)??? left??,??????(????)???
    right??,?????

26
?????????
  • ???(Preorder)
  • ???????????????????????
  • ??????????,?ABCD
  • ???(Inorder)
  • ???????????????????????
  • ??????????,?ABCD
  • ???(Postorder)
  • ???????????????????????
  • ??????????,?ABCD

27
????
  • ???????????
  • ???????,????????
  • ????
  • fact(0) 1
  • fact(n) n fact(n-1) (if n gt 1)
  • ???????????,???? n-1?????? n???,????????

28
?????
29
?????
30
?????
Write a Comment
User Comments (0)
About PowerShow.com