Looking for FIT2004 Algorithms and data structures - S2 2026 test answers and solutions? Browse our comprehensive collection of verified answers for FIT2004 Algorithms and data structures - S2 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!
Complexity and graph bounds
A graph is stored as an adjacency list. A traversal visits each vertex once and, at each vertex, walks that vertex's list of neighbours. What is its total running time?
Network flow
Ford-Fulkerson stops when the residual network has no path from s to t. What does that prove?
Tries and suffix trees
Assume we have one fixed text T of length n and many patterns to look for, each of length m. Searching T for a single pattern with a linear-time matching algorithm costs Θ(n + m). How does building the suffix tree of T once improve on that?
Balanced search trees
What exactly does the AVL balance condition require?
Complexity and graph bounds
G is a simple, connected, undirected graph on at least two vertices. Which is always true?
Network flow
The residual network contains a backward arc (v, u) for every arc (u, v) that carries flow. What is it for?
Balanced search trees
How do an AVL tree and a red-black tree compare?
Balanced search trees
During a standard AVL insertion, what is the maximum number of separate rebalancing steps needed? Count a single or a double rotation at one unbalanced ancestor as one step.
Shortest paths with negative weights
You run |V| − 1 passes of Bellman-Ford, then one more pass, and during that extra pass some distance value decreases. What does that tell you?
A workshop has five jobs to run today. Each job runs on exactly one machine, each machine can run only a limited number of jobs in a day, and each job needs a machine with the right tooling. The workshop wants to run as many jobs as possible.
| machine | maximum number of jobs |
|---|---|
m1 | 1 |
m2 | 1 |
m3 | 3 |
| machine | jobs it can take |
|---|---|
m1 | j1 |
m2 | j2, j4, j5 |
m3 | j1, j3 |
Someone proposes to solve this with a flow network. It has a source s, one vertex per machine, one vertex per job and a sink t, with these edges:
| edges | how the proposal defines them |
|---|---|
| source edges | from the source to each machine, with capacity equal to that machine's own limit |
| middle edges | from each machine to each job it is allowed to take, with capacity 1 |
| sink edges | from each job to the sink, with capacity equal to the number of machines that could take that job |
They compute a maximum flow in it and report its value as the number of jobs that can be covered.
The proposal is wrong: on the instance above it reports a number that is too large. Answer all four parts.
Write in plain text. You may describe edges as s -> v1 and so on.