COSC 1P03 Data Structures and Abstraction 18.1
COSC 1P03 Data Structures and Abstraction 18.1
COSC 1P03 Data Structures and Abstraction 18.1
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>COSC</strong> <strong>1P03</strong><br />
<strong>Data</strong> <strong>Structures</strong> <strong>and</strong> <strong>Abstraction</strong><br />
<strong>COSC</strong> <strong>1P03</strong><br />
<br />
implementation<br />
instance variables<br />
count<br />
constructors<br />
empty state<br />
methods<br />
enter<br />
overflow<br />
increment<br />
leave, front<br />
underflow<br />
length, empty<br />
compute?<br />
empty vs full<br />
<strong>Data</strong> <strong>Structures</strong> <strong>and</strong> <strong>Abstraction</strong> 18.7<br />
<strong>COSC</strong> <strong>1P03</strong><br />
Queue ADT<br />
Linked Implementation<br />
<br />
<br />
<br />
sequentially-linked structure of items<br />
deletion from front<br />
insertion at end<br />
keep pointer to rear O(1)<br />
length?<br />
keep count else O(n)<br />
comparison with contiguous<br />
all operations O(1)<br />
space tradeoffs<br />
<strong>Data</strong> <strong>Structures</strong> <strong>and</strong> <strong>Abstraction</strong> 18.8<br />
front<br />
rear<br />
Figure 18.5 Linked queue representation<br />
18.3