What takes a code less time to completely execute? | Sololearn: Learn to code for FREE!

+3

What takes a code less time to completely execute?

I often wonder how to make my algorithms take less time while execution.

7/2/2018 6:42:52 PM

Infinity

5 Answers

New Answer

+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