logo

Crowdly

Browser

Додати до Chrome

FIT1008-FIT2085 Fundamentals of algorithms - S1 2025

Шукаєте відповіді та рішення тестів для FIT1008-FIT2085 Fundamentals of algorithms - S1 2025? Перегляньте нашу велику колекцію перевірених відповідей для FIT1008-FIT2085 Fundamentals of algorithms - S1 2025 в learning.monash.edu.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

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]

Переглянути це питання
What is the best- and worst-case time complexity of Insertion Sort?
Переглянути це питання
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%
Переглянути це питання
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%
Переглянути це питання
Which of the following data structures is commonly used to implement a queue?
0%
0%
0%
0%
Переглянути це питання

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%
Переглянути це питання

What is the main advantage of using tail recursion?

0%
0%
0%
0%
Переглянути це питання

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)

0%
0%
Переглянути це питання

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%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на learning.monash.edu?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome