Update time_complexity.md

Refine the first paragraph to keep the definition of time complexity
This commit is contained in:
Enlightenus 2024-07-30 00:03:29 -07:00 committed by GitHub
parent 3e83c95912
commit f5a92cd682
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
# Time complexity # Time complexity
Time complexity describes the run time of an algorithm as a function of the size of the input data.
We can directly and accurately assess the efficiency an algorithm by measuring the run time. How to accurately assess the run time of an algorithm? The direct way to assess the efficiency of an algorithm is measuring the run time. How to accurately measure the run time of an algorithm?
1. **Determining the Running Platform**: This includes hardware configuration, programming language, system environment, etc., all of which can affect the efficiency of code execution. 1. **Determining the Running Platform**: This includes hardware configuration, programming language, system environment, etc., all of which can affect the efficiency of code execution.
2. **Evaluating the Run Time for Various Computational Operations**: For instance, an addition operation `+` might take 1 ns, a multiplication operation `*` might take 10 ns, a print operation `print()` might take 5 ns, etc. 2. **Evaluating the Run Time for Various Computational Operations**: For instance, an addition operation `+` might take 1 ns, a multiplication operation `*` might take 10 ns, a print operation `print()` might take 5 ns, etc.