Define computational complexity and describe its importance in evaluating/comparing algorithms
...
![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 21.02.2020 01:33, zoseta
Define computational complexity and describe its importance in evaluating/comparing algorithms
Explain the difference between empirical runtime analysis and computational complexity
How to determine the Big-O notation from the from T(n), the number of operations which is a function of n(the data size)?
Derive T(n) for the following iterative functions and determine Big-O
a.
def check(n):
if n%2==0:
return False
i = 3
ul = math. sqrt(n)
while i <= ul:
if n % i == 0:
return False
i += 2
return True
b.
def f1(array):
for i in range(len(array)):
item = array[i]
destination = i
while destination > 0 and array[destination - 1] >
item: array[destination] = array[destination - 1] destination -= 1
array[destination] = item
Derive T(n) for the following recursive functions and determine Big-O
a.
def check4(n):
if n % 4 > 1:
return n
return check4(n/4)
b.
def quickSort(arr, start, end):
if start < end:
pivot_index = partition(arr, start, end)
quickSort(arr, start, pivot_index - 1)
quickSort(arr, pivot_index + 1, end)
![answer](/tpl/images/cats/otvet.png)
Answers: 3
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 16:00, sdonachy7
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Do you know the correct answer?
Questions in other subjects:
![Konu](/tpl/images/cats/en.png)
English, 08.06.2020 18:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 08.06.2020 18:57
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 08.06.2020 18:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 08.06.2020 18:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 08.06.2020 18:57
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 08.06.2020 18:57
![Konu](/tpl/images/cats/himiya.png)
Chemistry, 08.06.2020 18:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 08.06.2020 18:57