@@ -31,7 +31,7 @@ public <T extends Comparable<T>> int findIndex(T[] array, T key) {
31
31
int fibN2 =0 ;// (n-2)th Fibonacci term
32
32
int fibN =fibN1 +fibN2 ;// nth Fibonacci term
33
33
34
- //fibN should store the smallest Fibonacci Number greater than or equal to size
34
+ // fibN should store the smallest Fibonacci Number greater than or equal to size
35
35
while (fibN <size ) {
36
36
fibN2 =fibN1 ;
37
37
fibN1 =fibN ;
@@ -45,20 +45,20 @@ public <T extends Comparable<T>> int findIndex(T[] array, T key) {
45
45
// Check if fibN2 is a valid location
46
46
int i =min (offset +fibN2 ,size -1 );
47
47
48
- //If key is greater than the value at index fibN2, cuts the sub-array from offset to i
48
+ // If key is greater than the value at index fibN2, cuts the sub-array from offset to i
49
49
if (array [i ].compareTo (key ) <0 ) {
50
50
fibN =fibN1 ;
51
51
fibN1 =fibN2 ;
52
52
fibN2 =fibN -fibN1 ;
53
53
offset =i ;
54
54
}
55
55
56
- //If x is greater than the value at index fibN2, cuts the sub-array after i+1
56
+ // If x is greater than the value at index fibN2, cuts the sub-array after i+1
57
57
else if (array [i ].compareTo (key ) >0 ) {
58
58
fibN =fibN2 ;
59
59
fibN1 =fibN1 -fibN2 ;
60
60
fibN2 =fibN -fibN1 ;
61
- }else return i ;//Element found
61
+ }else return i ;// Element found
62
62
}
63
63
// comparing the last element with key
64
64
if (fibN1 ==1 &&array [offset +1 ].compareTo (key ) ==0 )