![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Fibonacci search algorithm More...
#include <iostream>#include <vector>#include <cassert>#include <cstdlib>#include <algorithm>Go to the source code of this file.
Functions | |
| int | fibonacci_search (const std::vector< int > &arr, int value) |
| using fibonacci search algorithm finds an index of a given element in a sorted array | |
| bool | no_occurence_tests () |
| random tests for checking performance when an array doesn't contain an element | |
| bool | random_tests () |
| random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for | |
| int | main () |
Definition in file fibonacci_search.cpp.
| int fibonacci_search | ( | const std::vector< int > & | arr, |
| int | value ) |
using fibonacci search algorithm finds an index of a given element in a sorted array
| arr | sorted array |
| value | value that we're looking for |
Definition at line 23 of file fibonacci_search.cpp.
| int main | ( | void | ) |
Main Function testing the algorithm
Definition at line 123 of file fibonacci_search.cpp.
| bool no_occurence_tests | ( | ) |
random tests for checking performance when an array doesn't contain an element
Definition at line 72 of file fibonacci_search.cpp.
| bool random_tests | ( | ) |
random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for
Definition at line 96 of file fibonacci_search.cpp.