logo

Crowdly

Browser

Add to Chrome

FIT2004 Algorithms and data structures - S1 2026

Looking for FIT2004 Algorithms and data structures - S1 2026 test answers and solutions? Browse our comprehensive collection of verified answers for FIT2004 Algorithms and data structures - S1 2026 at learning.monash.edu.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Find a closed-form solution for the following recurrence relation:

 T(n) = \begin{cases}
2T(n-2)+a, & \text{if } n > 0,\\
b, & \text{if } n = 0,
\end{cases}

T(n) = \begin{cases}

2T(n-2)+a, & \text{if } n > 0,\\

b, & \text{if } n = 0,

\end{cases}

where aa and bb are positive constants. Assume nn is even. You may optionally provide working & verification, although please clearly state your closed form at the bottom of the response.

View this question

Consider the following algorithm. Assume the input array contains numbers.

1

2

3

4

5

6

function SUMMATION(array[1..n])

sum = array[1]

for k = 2 to n do

# The invariant is here.

sum = sum + array[k]

return sum

Prove that the following invariant holds at line 4:

For any value of kk between 2 and nnsum is equal to the sum of elements of array[1..k-1].

You will need to show:

  • The initialisation step
  • The maintenance step

You do not need the termination step.

View this question

You find yourself curiously stranded on a n by n mysterious grid (shown below), unsure of how you got there, or how to leave. You denote the rows of the grid from bottom to top as 1, 2, ..., n, and similarly denote the columns from left to right as 1, 2, ..., n. Cell (i, j) refers to row i, column j.

You are currently standing at the bottom-left corner of the grid and wonder to yourself how many different ways there are to walk to the top-right corner of the grid. However, there are certain conditions on the grid's cells.

In the normal cells of the grid (cells with white background below), you feel fatigued and are only able to move to the cell to the immediate right (to the next column). In the special cells of the grid (cells with blue background below), you feel more energised and are able to move either to the cell that is immediately up (to the next row) or immediately right (to the next column).

Which of the following options describe correct dynamic programming recurrences for those cells? Select all correct options.

View this question

You find yourself curiously stranded on a n by n mysterious grid (shown below), unsure of how you got there, or how to leave. You denote the rows of the grid from bottom to top as 1, 2, ..., n, and similarly denote the columns from left to right as 1, 2, ..., n. Cell (i, j) refers to row i, column j.

You are currently standing at the bottom-left corner of the grid and wonder to yourself how many different ways there are to walk to the top-right corner of the grid. However, there are certain conditions on the grid's cells.

In the normal cells of the grid (cells with white background below), you feel fatigued and are only able to move to the cell to the immediate right (to the next column). In the special cells of the grid (cells with blue background below), you feel more energised and are able to move either to the cell that is immediately up (to the next row) or immediately right (to the next column).

Which of the following options describe correct dynamic programming recurrences for those cells? Select all correct options.

0%
0%
0%
0%
0%
0%
View this question

You find yourself curiously stranded on a n by n mysterious grid (shown below), unsure of how you got there, or how to leave. You denote the rows of the grid from bottom to top as 1, 2, ..., n, and similarly denote the columns from left to right as 1, 2, ..., n. Cell (i, j) refers to row i, column j.

You are currently standing at the bottom-left corner of the grid and wonder to yourself how many different ways there are to walk to the top-right corner of the grid. However, there are certain conditions on the grid's cells.

In the normal cells of the grid (cells with white background below), you feel fatigued and are only able to move to the cell to the immediate right (to the next column). In the special cells of the grid (cells with blue background below), you feel more energised and are able to move either to the cell that is immediately up (to the next row) or immediately right (to the next column).

Which of the following options describe correct dynamic programming recurrences for those cells? Select all correct options.

View this question

You find yourself curiously stranded on a n by n mysterious grid (shown below), unsure of how you got there, or how to leave. You denote the rows of the grid from bottom to top as 1, 2, ..., n, and similarly denote the columns from left to right as 1, 2, ..., n. Cell (i, j) refers to row i, column j.

You are currently standing at the bottom-left corner of the grid and wonder to yourself how many different ways there are to walk to the top-right corner of the grid. However, there are certain conditions on the grid's cells.

In the normal cells of the grid (cells with white background below), you feel fatigued and are only able to move to the cell to the immediate right (to the next column). In the special cells of the grid (cells with blue background below), you feel more energised and are able to move either to the cell that is immediately up (to the next row) or immediately right (to the next column).

Which of the following options describe correct dynamic programming recurrences for those cells? Select all correct options.

0%
0%
0%
0%
0%
0%
0%
View this question

You are running the Kruskal's algorithm to obtain the minimum spanning tree of a connected, undirected, weighted graph with 10 vertices (ID-0 to ID-9). Given the following parent array state of the union-find data structure during the algorithm's run, which of the following statement(s) is true?

View this question

Consider the undirected graph below and Kruskal's algorithm for computing a minimum spanning tree. In which order are the edges added to the solution?

graph

View this question

Consider the undirected graph below and Prim's algorithm for computing a minimum spanning tree using node S as the source node. In which order are the edges added to the solution?

graph

View this question

You are running the Kruskal's algorithm to obtain the minimum spanning tree of a connected, undirected, weighted graph with 10 vertices (ID-0 to ID-9). Given the following parent array state of the union-find data structure during the algorithm's run, which of the following statement(s) is true?

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