How are algorithms compared?
Answer:
Algorithms are compared by checking their time and space complexity.
Time complexity is the amount of processing time an algorithm requires to run.
Space complexity is the amount of memory that is needed to execute an algorithm.