Arrange the function in ascending order based on time complexity?(Questions in code as comments) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Arrange the function in ascending order based on time complexity?(Questions in code as comments)

https://code.sololearn.com/ca0l2TtBuc1G/?ref=app https://code.sololearn.com/ca0l2TtBuc1G/?ref=app

28th Oct 2022, 2:34 PM
King
King - avatar
1 Resposta
0
1. n^(0.5) - O(āœ“n) : This function has polynomial time complexity, O(āœ“n). It grows slower than linear but faster than logarithmic. 2. log4n - O(log n) : This function has logarithmic time complexity, O(log n), but with a different base. It grows slower than nlogn. 3. n - O(n) : This function has linear time complexity, O(n). It grows linearly with the input size. 4. nlog2n - O(nlogn) : This function has logarithmic time complexity, O(nlogn). It grows faster than linear but slower than quadratic. 5. nĀ² - O(nĀ²) : This function has quadratic time complexity, O(nĀ²). It grows quadratically with the input size. 6. 5^(log2n) - O(n^2.321) : This function can be simplified to n^(log2āµ), which is approximately n^2.321. It has polynomial time complexity, O(n^c), where š‘ is a constant. 7. 1 - 3āæ - O(3āæ) : This function has exponential time complexity, O(3āæ). And n increases, the function grows rapidly. 8. 2^2n - O(2āæ)
7th May 2024, 1:26 AM
`Š½Ń‚Ń‚pā“ā°ā¶
`Š½Ń‚Ń‚pā“ā°ā¶ - avatar