Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ocarteleanu/fibonaccisequence
- Owner: ocarteleanu
- Created: 2021-02-24T03:46:46.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-24T16:57:49.000Z (almost 4 years ago)
- Last Synced: 2024-06-17T05:43:39.109Z (6 months ago)
- Language: Java
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 methodsFibonacciSequence 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.