0

How can i compare the efficiency of two algorithms?

6th Feb 2017, 8:12 PM
Shahiryar Arif
Shahiryar Arif - avatar
6 Respuestas
+ 7
You can also use the amount of space it takes up in bits...
6th Feb 2017, 8:47 PM
J.G.
J.G. - avatar
+ 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.
6th Feb 2017, 8:15 PM
Gage Hembach
Gage Hembach - avatar
+ 2
by measuring the difference in time needed to execute them.
6th Feb 2017, 8:15 PM
seamiki
seamiki - avatar
+ 1
write a timer that starts when the algorithms starts and stops when it is done
6th Feb 2017, 11:17 PM
LordHill
LordHill - avatar
0
3rd Sep 2021, 6:34 AM
20T1020 Diksha_ Borkar
20T1020 Diksha_ Borkar - avatar