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!
What is the worst-time complexity of the following function if the input list is of size n?
def mystery(my_list: ArrayList) -> None:
my_queue = Queue(len(my_list) * 2)
for item in my_list:
my_queue.append(item)
my_queue.append(item)
while not my_queue.is_empty():
print(my_queue.serve())
If we need to frequently use the difference() operation for two sets, what implementation of the Set ADT would be "cheaper" in terms of the time complexity of this operation?
Stack pops items in the following order:
What does the following code do?
def mystery(a_list, b_list):
my_stack = Stack(len(a_list)+len(b_list))
my_list = List(len(a_list)+len(b_list))
for item in a_list:
my_stack.push(item)
for item in b_list:
my_stack.push(item)
while not my_stack.is_empty():
my_list.append(my_stack.pop())
return my_list
Order these operations from fastest to slowest based on their time complexity. Recall that the complexity of some of these operations may be measured with respect to different inputs.
What in the following are Set ADT operations?
Given that there are n items in a list to sort, what's the maximum number of swaps (or copies for shuffling elements) for Insertion Sort per iteration?
Given a numeric algorithm taking an arbitrary integer n as input, with respect to what should its complexity be analysed?
Estimate the complexity of the following function in terms of the input integer n:
def mystery(n: int) -> int:
result = 0
for i in range(n):
for j in range(i):
result += i * j
return result
Is Insertion Sort Incremental?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!