Looking for FIT1008-FIT1054-FIT2085 Fundamentals of algorithms - S2 2025 test answers and solutions? Browse our comprehensive collection of verified answers for FIT1008-FIT1054-FIT2085 Fundamentals of algorithms - S2 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!
Given the below code, what is the contents of the mystery object at the end of the following block of code:
mystery = ArraySet(10)
mystery.add(1)
mystery.add(1)
mystery.add(2)
mystery.add(3)
mystery.remove(3)
print(mystery)
What is the worst-case time complexity of Linear Search using an unsorted array of size N (ignore the cost of item comparison).
What is the worst-case time complexity of this function?
def func(n):
counter = 0
i = 1
while i <= n:
for j in range(i):
counter += 1
i *= 2
return counter
What is the worst-case time complexity of this function?
Make sure you define any variables you use and you can ignore the cost of comparison. (no explanation, no marks)
def func(arr: List[int], target: int) -> List[int]:
n = len(arr)
for i in range(n - 1):
for j in range(i + 1, n):
if arr[i] + arr[j] == target:
return [i, j]
return []
What does the peek operation in a Stack do?
I want to keep track of the number of collisions I have. So far, I have observed 2 collisions. No items have been removed from the hash table. I add a single item Charlie to the hash table. The hash position for Charlie is 0. What will my updated collision count be?
Note: We are using Linear Probing to handle collision resolution.
I want to keep track of the number of collisions I have. So far, I have observed 2 collisions. No items have been removed from the hash table. I add a single item Charlie to the hash table. The hash position for Charlie is 3. What will my updated collision count be?
Note: We are using Linear Probing to handle collision resolution.
Can separate chaining collision resolution can be implemented using Array instead of linked nodes?
Is separate chaining a collision resolution mechanism based on open addressing?
You want to create a shopping list of items you need from the supermarket. What would be most appropriate to store your items? Assume we want to collect the items in any order from the shopping list.