???????C ???? ???? ???? - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

???????C ???? ???? ????

Description:

Title: 4 Author: Last modified by: akcell Created Date: 7/7/2002 2:31:24 PM Document presentation format – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 31
Provided by: 7873
Category:
Tags: queues | stacks

less

Transcript and Presenter's Notes

Title: ???????C ???? ???? ????


1
?4? ?????
???????C???? Fundamentals of Data Structures
and Their Applications Using C
???????C????

???? ????
2
??????
  • ??(Stack)
  • a
  • ?????????????????(Top)
  • ????????????????????
  • ???????????????????????

3
??????
  • ????????????
  • 1. ??????
  • ?????????(Declaration)??,????????(???
  • ?????N,??????0???????)????????
  • 2.???????(Push)
  • ??Top???,???????,????????
  • ????(?????)?
  • 3.????(Pop)
  • ???????,????????,???Top????
  • 4.????????
  • ??Top??????N-1?(?????)?
  • 5.?????????
  • Top???0(??)?Top??NULL(????)?

4
??????
  • ????????(????????)

5
??????
  • ????????(??????????)

6
??????
  • ????????(??????????)

7
??????
  • ?????
  • 1.?????????
  • ??A ????? B ???B??????C

8
??????
  • ?????
  • 2.??????
  • ????????????
  • ?????????

9
??????
  • ?????
  • 2.??????
  • ???????????
  • ???1?
  • (1). ????????????????????
  • (2). ??????(???(???)?
  • ) ???(???)?
  • (3). ????????

10
??????
  • ?????
  • 2.??????
  • ???????????
  • ??1?? A-B(CD)/E ??????????
  • (1)
  • (2)
  • (3) ABCDE/-

11
??????
  • ?????
  • 2.??????
  • ???????????
  • ???2?
  • (1). ???????????,????????x?
  • (2). switch(x)
  • case('(') ?x????
  • break
  • case(')') x???????????
  • while(x !'(')
  • ?x???????
  • x???????????
  • break

12
??????
  • case('')
  • case('-')
  • case('')
  • case('/') y ???????? // ???????
  • while(y ??????x)
  • ??????????????????
  • y ????????
  • ?x????
  • break
  • default // x????
  • ?x???????
  • break
  • (3).????????????????????,?????????

13
??????
  • ?????
  • 2.??????
  • ??2???????A-B(CD)/E????????

14
??????
  • ?????
  • 3.????????
  • ??3???A99,B 7,C3,D5,E4,
  • ???? ABCDE/- ??????

15
??????
  • ??(Queue)
  • ??????????
  • ????????????????????
  • ???????????(Rear),???????????(Front)
  • ?????????????????????
  • ??

16
??????
  • ???????????
  • 1.??????
  • ???????????????,???????,
  • ? FrontRear-1 ? FrontRearNULL(0)?
  • 4.????????
  • ?RearN-1?,???????(????????N,
  • ??????0???????)?
  • 2.???????
  • ??????,???Rear???????????Rear???
  • 5.????????
  • ? FrontRear?,?????
  • 3.?????????
  • ?????,???Front????Front???????????

17
??????
  • ????????(?????)

18
AddQ
AddQ(char item) char Queue5 int Max5 if
(rear Max -1) printf (the queue is
full') else rear rear 1
Queuerearitem return( )
19
DeleteQ
DeleteQ(char item) char Quene5 int Max5
if (front rear) printf (the queue is
empty) else front front 1
item queuefront queuefront
return(item)
20
??????
  • ?????
  • 1. ????(Circular Queues)
  • ??????????

21
??????
  • ?????
  • 1. ????(Circular Queues)-?
  • ????????????

22
AddCQ
AddCQ(char item) char Queue5 int n5 if
(front(rear1) mod n) printf (the queue is
full') else rear (rear1) mod n
Queuerearitem return( )

23
DeleteCQ
DeleteCQ(char item) char Quene5 int n5
if (front rear) printf (the queue is
empty) else front (front1) mod n
item queuefront
queuefront return(item)

24
??????
  • ?????
  • 2.????(Priority Queues)
  • ??????(??????)

25
??????
  • ?????
  • 2.????(Priority Queues)
  • ??????(????????)

26
??????
  • ?????
  • 3.????(Double Ended Queues)
  • ??????A?B?C,???????????

27
?????????(Multiple Stacks and Queues)
  • ????

28
?????????(Multiple Stacks and Queues)
  • ????
  • ????

29
?????????(Multiple Stacks and Queues)
  • ??????

30
?????????(Multiple Stacks and Queues)
  • ????
Write a Comment
User Comments (0)
About PowerShow.com