There are two kinds of algorithm efficiency: time efficiency and space efficiency. What is the difference between them?
Answer-
Difference between time efficiency and space efficiency-
Sr.No. | Time efficiency | Space efficiency |
1. | It means the time required for an algorithm to execute. |
It means the memory required for an algorithm to execute. |
2. | It is also called time complexity. | It is also called space complexity. |
3. | The time efficiency is expressed by asymptotic notations i.e.Big O - O(n),Big Theta - Θ(n) and Big Omega - Ω(n) | Space efficiency is generally expressed by
Big O- (O(n)) notation. |
4. | The time efficiency is analyzed in three ways i.e.worst case,average case and best case. | The Space efficiency is analyzed in terms of instruction space,data space and run-time stack space. |
Get Answers For Free
Most questions answered within 1 hours.