logo

Crowdly

Browser

Add to Chrome

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!

1. What is an abstract data type and how does it differ from data type? Give an example of an abstract data type and also of a data type in Python. [3]

2. Briefly describe Stack ADT giving details about [4]

  • Main property of a Stack ADT [2]
  • Key operations of the Stack ADT [2]

3. What is the best-case and worst-case time complexity of operation pop() for a Stack ADT, if implemented with an array? (no explanation, no marks) . [3]

View this question
What is the best- and worst-case time complexity of Insertion Sort?
View this question
If a stack is used to check for balanced parentheses in an expression, what is the time complexity of the algorithm?

Consider n to be the length of the expression.
0%
0%
0%
0%
View this question
Given the below code what is the length of the union of the two sets x and y at the end of the following block of code:

x = ASet(10)

y = ASet(10)

x.add(1)

x.add(1)

y.add(9)

y.add(2)
0%
0%
0%
View this question
Which of the following data structures is commonly used to implement a queue?
0%
0%
0%
0%
View this question

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)

0%
100%
View this question

What is the main advantage of using tail recursion?

0%
0%
0%
0%
View this question

For a function to be recursive (and practical in Python), what should it have?

View this question

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)

0%
0%
View this question

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)

0%
0%
0%
0%
View this question

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

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

Browser

Add to Chrome