Stacks-queues ADT by Randy Wang

Stacks-queues ADT by Randy Wang - CS 126 Lecture P5:...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 126 Lecture P5: Abstract Data Type
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS126 6-1 Randy Wang Outline Introduction Stacks (and queues) Stack and queue applications
Background image of page 2
CS126 6-2 Randy Wang Data Type and ADT
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS126 6-3 Randy Wang Interface, Implementation, and Client Volume Channel Client Interface Im plementation
Background image of page 4
CS126 6-4 Randy Wang Advantages of ADT
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS126 6-5 Randy Wang “Non-ADTs” interface: typedef struct {int p; int q;} Rational; client: Rational a; a.p = 3; Non-ADT interface: typedef struct {int p; int q;} Rational; client: Rational a; setRational(&r, 3); void setRationalP(Rational *r; int x); ADT implementation: void setRationalP(Rational *r; int x) {r->p = x;}
Background image of page 6
CS126 6-6 Randy Wang Outline Introduction Stacks (and queues) Stack and queue applications
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS126 6-7 Randy Wang Stack and Queue Definitions
Background image of page 8
6-8 Randy Wang Interface, Implementation, and Client “Client” needs to know how to use the “interface” “Implementation” needs to know what “interface” to implement
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

Stacks-queues ADT by Randy Wang - CS 126 Lecture P5:...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online