Looking for FIT1008-FIT2085 Fundamentals of algorithms - S1 2025 test answers and solutions? Browse our comprehensive collection of verified answers for FIT1008-FIT2085 Fundamentals of algorithms - S1 2025 at learning.monash.edu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Is the following function tail-recursive?
def fib (n: int) -> int:
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n - 1) + fib(n - 2)
What is the main advantage of using tail recursion?
For a function to be recursive (and practical in Python), what should it have?
Is the following function tail-recursive?
def fib (n: int, a: int = 0, b: int = 1) -> int:
if n == 0:
return a
elif n == 1:
return b
else:
return fib(n - 1, b, a + b)
What is the time complexity of the following function if measured with respect to n?
def mystery(n: int) -> None:
if n <= 0:
return
else:
if n % 2 == 0:
mystery(n - 1)
else:
mystery(n // 2)
I want to keep track of the number of conflicts and collisions I have. So far, I have observed 4 conflicts and 2 collisions. I add a single item Charlie to the hash table. The hash position for Charlie is 0. What will my updated values be?
What is one disadvantage of Linear Probing?
I have a Hash Table with Linear Probing and lazy deletion. I am searching for an item, and notice whilst searching I skipped over multiple slots marked for deletion. What should I do?
I want to traverse through a Dictionary implemented as a Linear Probing Hash Table, how should I do it?
I want to keep track of the number of conflicts and collisions I have. So far, I have observed 4 conflicts and 2 collisions. I add a single item Charlie to the hash table. The hash position for Charlie is 4. What will my updated values be?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!