logo

Crowdly

FIT1008-FIT2085 Fundamentals of algorithms - S1 2025

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

View this question

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?

View this question

Stack pops items in the following order:

0%
100%
0%
View this question

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

0%
0%
100%
0%
View this question

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.

View this question

What in the following are Set ADT operations?

0%
50%
0%
View this question

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?

100%
0%
0%
0%
View this question

Given a numeric algorithm taking an arbitrary integer n as input, with respect to what should its complexity be analysed?

0%
100%
0%
View this question

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

0%
100%
0%
0%
View this question

Is Insertion Sort Incremental?

View this question

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!