4 ms·
Now if you re-write the C code to use O(n) instead of O(n^2) algorithms, you will reduce the runtime even further as compared to the Python runtime. Of course t
by super_mario 15y ago
Now if you re-write the C code to use O(n) instead of O(n^2) algorithms, you will reduce the runtime even further as compared to the Python runtime. Of course the time cost savings may not be as important or dramatic any more, since the Python version sounds good enough (at least for the data set in question).
Runtimes of languages still matter. Same algorithm implementation may run significantly slower in some languages than others (and this is not necessarily the language issue but interpreter/compiler issue).