Sequences - Sequences 4/1/2003 8:57 AM Outline and Reading...

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

View Full Document Right Arrow Icon
4/1/2003 8:57 AM Sequences 1 Lists and Sequences 4/1/2003 8:57 AM Sequences 2 Outline and Reading Singly linked list Position ADT and List ADT (§5.2.1) Doubly linked list (§ 5.2.3) Sequence ADT (§5.3.1) Implementations of the sequence ADT (§5.3.3) Iterators (§5.5) 4/1/2003 8:57 AM Sequences 3 Singly Linked List A singly linked list is a concrete data structure consisting of a sequence of nodes Each node stores ± element ± link to the next node next elem node A B C D 4/1/2003 8:57 AM Sequences 4 Stack with a Singly Linked List We can implement a stack with a singly linked list The top element is stored at the first node of the list The space used is O ( n ) and each operation of the Stack ADT takes O (1) time t nodes elements 4/1/2003 8:57 AM Sequences 5 Queue with a Singly Linked List We can implement a queue with a singly linked list ± The front element is stored at the first node ± The rear element is stored at the last node The space used is O ( n ) and each operation of the Queue ADT takes O (1) time f r nodes elements 4/1/2003 8:57 AM Sequences 6 Position ADT The Position ADT models the notion of place within a data structure where a single object is stored A special
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.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University.

Page1 / 3

Sequences - Sequences 4/1/2003 8:57 AM Outline and Reading...

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