Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ocarteleanu/fibonaccisequence

A program that compares the runtime efficiency of the iterative and recursive methods when creating Fibonacci sequences
https://github.com/ocarteleanu/fibonaccisequence

Last synced: about 1 month ago
JSON representation

A program that compares the runtime efficiency of the iterative and recursive methods when creating Fibonacci sequences

Awesome Lists containing this project

README

        

# FibonacciSequence
A program that compares the runtime efficiency of the iterative and recursive methods when creating Fibonacci sequences
The program allows the user to enter an integer representing how long the sequence
generated will be. The program starts with the first two elements of the sequence.
All the elements in the sequence are represented by long type variables so that
the user can enter bigger numbers to create the sequence
The output of the program consists of displaying the last element of the sequence
generated in both ways so that it can be verified that the sequences are the same
and also displaying the runtime in nanoseconds for both methods

FibonacciSequence class contains the variables and methods necessary
to build Fibonacci sequences based on the user's input
The class offers the first two elements of the sequence to be generated, elementOne (0) and elementTwo(1). The
type of the elements in the sequence is long to allow higher numbers to be entered by the user. The lastElement
is the variable that will represent the last element of each generated sequence. The recursiveWayControl variable will
be used as a parameter in the recursive method.