Idek but hope u figure it out!
Look this up on Quizlet. Besure to check the question and the answers carefully by using "define + the vocabulary word" you think answers the question.
Here is the exact site: just copy it and search and click...
<span>AP Comp Sci Chapter 5</span>
Answer:
def doMyMath(n):
if n == 1:
return n
else:
return n*doMyMath(n-1)
Explanation:
This line defines the function
def doMyMath(n):
This line checks if n is 1. If yes, it returns n (1)
if n == 1:
return n
If otherwise, it calculates the fibonacci recursively
else:
return n*doMyMath(n-1)
To call the function from main, you can use:
print(doMyMath(5))
or
num = int(input("Number: "))
--- This gets the number from user
print("Result: ",doMyMath(num)) --- This calculates the factorial
<em>This question is answered in Python</em>
The 2 statements that correctly describe the time complexity of data structures with N data are:
- The average time complexity of data structures with N data is O(N).
- The average time complexity of inserting data into a heap is O(logN)
<h3>What is Time Complexity in the above case/</h3>
This is known to be the amount of times a specific instruction set is executed instead of the total time is taken.
Note that The 2 statements that correctly describe the time complexity of data structures with N data are:
- The average time complexity of data structures with N data is O(N).
- The average time complexity of inserting data into a heap is O(logN)
Learn more about data structure from
brainly.com/question/13147796
#SPJ1