Description
Fibonacci is implemented across nine files in different packages. Some are genuinely distinct algorithms and should stay separate (searches/FibonacciSearch.java, datastructures/heaps/FibonacciHeap.java, matrix/matrixexponentiation/Fibonacci.java).
But several are just "compute the n-th Fibonacci number" by a slightly different technique, and they are spread out with no link between them:
Proposed change
Group the "n-th Fibonacci" variants together (or at least add a short Javadoc note to each pointing to the others and explaining which technique it demonstrates, e.g. iterative vs. streams vs. closed-form vs. DP). The goal is that a reader can find all approaches from any one of them.
Description
Fibonacci is implemented across nine files in different packages. Some are genuinely distinct algorithms and should stay separate (
searches/FibonacciSearch.java,datastructures/heaps/FibonacciHeap.java,matrix/matrixexponentiation/Fibonacci.java).But several are just "compute the n-th Fibonacci number" by a slightly different technique, and they are spread out with no link between them:
maths/FibonacciLoop.javamaths/FibonacciJavaStreams.javamaths/FibonacciNumberCheck.javamaths/FibonacciNumberGoldenRation.javadynamicprogramming/Fibonacci.javarecursion/FibonacciSeries.javaProposed change
Group the "n-th Fibonacci" variants together (or at least add a short Javadoc note to each pointing to the others and explaining which technique it demonstrates, e.g. iterative vs. streams vs. closed-form vs. DP). The goal is that a reader can find all approaches from any one of them.