diff options
author | Adam Spragg <adam@spra.gg> | 2023-01-19 13:56:59 +0000 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2023-01-19 13:56:59 +0000 |
commit | 816b7d55d6d3dfb31904cb5d4813fb500984ab5b (patch) | |
tree | afae8fddf2117f17d132e0671858169acdeee1a4 /13.c | |
parent | 8f0114df375c7b9bd750e3e0e6fbecb964639d3d (diff) |
Puzzle 20: Do a linear scan for the num we're looking for
When the number of iterations was small, looking near the original
position of the num was a good idea. As the number of iterations
increases, the positions are fairly random, so speed of lookup is mostly
a factor of how quickly we can scan the whole buffer.
Speeds up part 2 of the problem from 2.2s to 0.12s.
Diffstat (limited to '13.c')
0 files changed, 0 insertions, 0 deletions