0
How can i compare the efficiency of two algorithms?
6 odpowiedzi
+ 7
You can also use the amount of space it takes up in bits...
+ 2
I believe you could do a time trial for each of them. Basically start a timer as they run to see how long it takes to go through the code and end it when it reaches the end. Print both times to see which was quicker.
+ 2
by measuring the difference in time needed to execute them.
+ 1
write a timer that starts when the algorithms starts and stops when it is done
0