subject
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)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
When is an original work considered public domain? a. when posted via social media b. when it is posted on the internet c. when a copyright symbol is not included with the piece of work d. when explicit permission is given by the author / owner
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
Define computational complexity and describe its importance in evaluating/comparing algorithms
...
Questions
question
Mathematics, 16.04.2020 23:45
question
Mathematics, 16.04.2020 23:46
Questions on the website: 13722363