Sequences - Sequence ADT ( 5.3) Sequences and Iterators The...

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

View Full Document Right Arrow Icon
Sequences and Iterators 1 © 2004 Goodrich, Tamassia Sequences and Iterators Sequences and Iterators 2 © 2004 Goodrich, Tamassia Sequence ADT (§ 5.3) The Sequence ADT is the union of the Vector and List ADTs Elements accessed by ± Rank, or ± Position Generic methods: ± size (), isEmpty () Vector- based methods: ± elemAtRank (r), replaceAtRank (r, o), insertAtRank (r, o), removeAtRank (r) List -b ased methods: ± first (), last (), prev (p), next (p), replace (p, o), insertBefore (p, o), insertAfter (p, o), insertFirst (o), insertLast (o), remove (p) Bridge methods: ± atRank (r), rankOf (p) Sequences and Iterators 3 © 2004 Goodrich, Tamassia Applications of Sequences The Sequence ADT is a basic, general- purpose, data structure for storing an ordered collection of elements Direct applications: ± Generic replacement for stack, queue, vector, or list ± small database (e.g., address book) Indirect applications: ± Building block of more complex data structures
Background image of page 1

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

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

Page1 / 2

Sequences - Sequence ADT ( 5.3) Sequences and Iterators The...

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

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