+ 3
What takes a code less time to completely execute?
I often wonder how to make my algorithms take less time while execution.
5 ответов
+ 3
https://www.sololearn.com/Discuss/1017028/?ref=app
hope it helps you...
+ 2
Saurabh Tiwari Thanks 😀
0
- Decrease number of steps required to finish
- Remove/replace time consuming tasks like calculating cos
0
Additionally to the suggestions from TurtleShell, using compilation time comes to my mind. For example in C++, the compiler is able to evaluate "const" and "constexpr" expressions at compile time, meaning it isn't necessary at runtime anymore, effectively decreasing the runtime of your program. For C++, look up "Template Meta Programming" for more information on this topic.
0
void writing lot of if else statement