+ 1

How to use fibbonacci series in c++ ,and how to make with EOS=0

26th Nov 2017, 5:17 PM
Ridzz
Ridzz - avatar
12 Antworten
0
If performance is not super important for you, the <chrono> thing might be overengineering, tho.
26th Nov 2017, 9:30 PM
Timon Paßlick
0
yes,fibbonacci series
26th Nov 2017, 9:01 PM
Ridzz
Ridzz - avatar
0
I also don't understand,this is the question We define as "value of a sequence of natural values ​​at any value that matches the sum of the two that the minimum there exists", obviously, the first and second unasequencia values ​​can never be values ​​because if a sequence has some Fib value ", it contains three elements. We want to detect the existence of a Fib value in a sequence of naturals.ons dent ENTRY: Sequence of naturals [Eos ol.OUTURE: Returns the position of the value" Fib found, or if no existe.EXEMPLES: Sequence [Naturals Eos = 0]: 9 8 1 1 8 7 9 16 8 9 0 Fib a posicio: 8
26th Nov 2017, 9:09 PM
Ridzz
Ridzz - avatar
0
Ok, so you use a range based for loop to go through the input sequence. You check whether the current element is a fibonacci value using an std::array with all the fibonacci values within the range of your data type. Make the array sorted so that binary_search from <algorithm> can be used. Then test if linear search or binary search is faster using <chrono> (not in the published executable of course). If the current element is a fibonacci number, you print that to the screen.
26th Nov 2017, 9:20 PM
Timon Paßlick
0
I looked in the internet: If your array size is below 80, it's faster to use linear search. Otherwise you should use binary search. No need for <chrono> checkings anymore. ( :
26th Nov 2017, 9:56 PM
Timon Paßlick
0
it's very confusing ,I wil try
26th Nov 2017, 9:57 PM
Ridzz
Ridzz - avatar
0
to use array and sequences position of Fibonacci
26th Nov 2017, 9:58 PM
Ridzz
Ridzz - avatar
- 1
Could you tell me what fib and eos is, please?
26th Nov 2017, 8:26 PM
Timon Paßlick
- 1
So fib means fibonacci. What does eos mean?
26th Nov 2017, 9:04 PM
Timon Paßlick
- 1
And does use mean implementing it or really finding a use for it?
26th Nov 2017, 9:05 PM
Timon Paßlick
- 1
What confused you?
26th Nov 2017, 9:57 PM
Timon Paßlick
- 1
It's to save execution time. You can also calculate for every element. That's slower but more straight-forward.
26th Nov 2017, 10:02 PM
Timon Paßlick