I saw an article * that you can speed up the execution time by combining memoization recursion and search. Try reimplementing the sample code in Python and Go.
https://github.com/kazuhirokomoda/algorithm-and-data-structure/blob/master/DP_recursive.py https://github.com/kazuhirokomoda/algorithm-and-data-structure/blob/master/DP_recursive.go
I touched Go for the first time this time, but it feels like I'm familiar with this content without any problems.
I also measured the execution time, but with the exact same algorithm average execution time (10 times) python: 23.14 [s] go: 7.398 [s] It was that kind of feeling. It would be nice to be able to use go when writing an algorithm quickly.
Recommended Posts