Caching the cycle length of small values, e.g. 1~100000 makes a lot sense, however, I found that even though the cycle length are cached, the runtime is still more than 50ms, among which 20ms was used to build the cache.
Any idea to further improve the runtime performance? Thanks a lot!
Search found 2 matches
- Wed Nov 29, 2006 2:03 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318536
- Mon Nov 27, 2006 9:39 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318536
100 runtime & mem usage
Can someone please shed some light on how to achieve good runtime and memory usage performance for problem 100, especially runtime?
There are a lot of gurus whose algorithms only cost less than 5ms, but my algorithm costs about 1s. I wonder how did they achieve this performance.
Thanks a lot
There are a lot of gurus whose algorithms only cost less than 5ms, but my algorithm costs about 1s. I wonder how did they achieve this performance.
Thanks a lot