23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

javadoc comments for this <strong>and</strong> most other <strong>Java</strong> code fragments presented <strong>in</strong> the<br />

rema<strong>in</strong>der of this book. Note that we use a symbolic name, CAPACITY, to<br />

specify the capacity of the array. This allows us to specify the capacity of the<br />

array <strong>in</strong> one place <strong>in</strong> our code <strong>and</strong> have that value reflected throughout.<br />

Code Fragment 5.4: Array-based <strong>Java</strong><br />

implementation of the Stack <strong>in</strong>terface. (Cont<strong>in</strong>ues <strong>in</strong><br />

Code Fragment 5.5.)<br />

270

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!