A non-virtual function says, you have to do this and you must do it this way. A virtual function says you have to do this, but you don't have to do it this way. That's their fundamental difference.
1 + 1 + 1 + .... + 1 kilometers (x miles = 2x kilometers). So here's a question...
We know that any natural number can be expressed (not uniquely) as the sum of Fibonacci factors. Given a (potentially huge) natural number, how can you write it as the sum of Fibonacci factors so that the smallest factor is as large as possible?
6 = 3 + 3 is "best" since all other factorizations involve factors less than 3. Similarly, 11 = 5 + 3 + 3 or 11 = 8 + 3 both have smallest factor 3 (and I think you can't do better).
Brute force works for small numbers, but becomes hard for large ones. Any ideas?
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
Any natural number N can be expressed as
1 + 1 + 1 + .... + 1 kilometers (x miles = 2x kilometers). So here's a question...
We know that any natural number can be expressed (not uniquely) as the sum of Fibonacci factors. Given a (potentially huge) natural number, how can you write it as the sum of Fibonacci factors so that the smallest factor is as large as possible?
e.g. for 6
6 = 1 + 5
6 = 2 + 2 + 2
6 = 1 + 2 + 3
6 = 1 + 1 + 2 + 2
6 = 3 + 3
etc.
6 = 3 + 3 is "best" since all other factorizations involve factors less than 3. Similarly, 11 = 5 + 3 + 3 or 11 = 8 + 3 both have smallest factor 3 (and I think you can't do better).
Brute force works for small numbers, but becomes hard for large ones. Any ideas?
Reply To This Comment