Refactored Identifiers (#5306)

Co-authored-by: Bama Charan Chhandogi <b.c.chhandogi@gmail.com>
This commit is contained in:
congyuluo
2024-08-08 07:09:00 -07:00
committed by GitHub
parent 6e23e198ab
commit cafea1ee52
3 changed files with 11 additions and 11 deletions

View File

@ -62,10 +62,10 @@ public class FibonacciSearch implements SearchAlgorithm {
Integer[] integers = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
int size = integers.length;
Integer shouldBeFound = 128;
Integer targetValue = 128;
FibonacciSearch fsearch = new FibonacciSearch();
int atIndex = fsearch.find(integers, shouldBeFound);
int atIndex = fsearch.find(integers, targetValue);
System.out.println("Should be found: " + shouldBeFound + ". Found " + integers[atIndex] + " at index " + atIndex + ". An array length " + size);
System.out.println("Should be found: " + targetValue + ". Found " + integers[atIndex] + " at index " + atIndex + ". An array length " + size);
}
}