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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A Fibonacci Progression Class<br />

As a further example, we def<strong>in</strong>e a FibonacciProgression class that<br />

represents another k<strong>in</strong>d of progression, the Fibonacci progression, where the next<br />

value is def<strong>in</strong>ed as the sum of the current <strong>and</strong> previous values. We show class<br />

FibonacciProgression <strong>in</strong> Code Fragment 2.5. Note our use of a<br />

107

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

Saved successfully!

Ooh no, something went wrong!