Flashcard Deck · 20 cards · Public

FIT2004 - Algorithms & Data Structures (Monash)

Master core computer science algorithms with this targeted FIT2004 revision deck covering Dynamic Programming, Network Flow, Greedy Algorithms, and String Matching.

Cards in this deck

(20 cards)

Preview terms and definitions before starting your study session.

#1
Term
Dynamic Programming: Key Properties
Definition
What two key properties must a problem exhibit to be solvable using Dynamic Programming?
1. Optimal Substructure: An optimal solution to the problem contains optimal solutions to its subproblems.
2. Overlapping Subproblems: A recursive algorithm revisits the same subproblems repeatedly rather than generating new ones.
#2
Term
Top-Down vs. Bottom-Up Dynamic Programming
Definition
Compare Top-Down (Memoization) and Bottom-Up (Tabulation) DP approaches:
  • Top-Down (Memoization): Uses recursion and caches subproblem results in a lookup table (array/hash map) to avoid recomputation.
  • Bottom-Up (Tabulation): Uses iteration to fill a lookup table starting from the smallest base cases up to the desired result, avoiding recursion stack overhead.
#3
Term
Greedy Choice Property & Exchange Argument
Definition
What is the Greedy Choice Property and how is it typically proven?
  • Greedy Choice Property: A locally optimal choice leads to a globally optimal solution.
  • Exchange Argument: A proof technique where you assume an optimal non-greedy solution exists, then systematically modify (exchange) its choices with greedy choices without decreasing solution quality, proving the greedy solution is also optimal.
#4
Term
Huffman Coding Complexity & Strategy
Definition
How does Huffman Coding work and what is its time complexity?
  • Strategy: Constructs an optimal prefix code for data compression using a greedy approach by repeatedly merging the two lowest-frequency nodes.
  • Complexity: using a Min-Heap/Priority Queue, where is the alphabet size.
#5
Term
Trie (Prefix Tree) Operations Complexity
Definition
What is a Trie and what are its search, insertion, and prefix matching time complexities?
  • Definition: A tree structure where nodes represent characters along shared prefixes of keys.
  • Complexity: time for search, insertion, and prefix search, where is the length of the string, independent of the total number of keys stored in the Trie.
#6
Term
KMP Algorithm: Failure Function (\pi Array)
Definition
What is the Failure Function ( array or Lookup Table) in the Knuth-Morris-Pratt (KMP) string matching algorithm?
  • Definition: stores the length of the longest proper prefix of P[0..i] that is also a suffix of P[0..i].
  • Purpose: Dictates how far to shift the pattern on mismatch without re-evaluating characters in the text already matched.
#7
Term
KMP Algorithm Time Complexity
Definition
What is the overall time complexity of the KMP algorithm for searching a pattern of length in a text of length ?
  • Precomputation: to compute the failure function .
  • Matching: time.
  • Total Complexity: time and extra space.
#8
Term
Residual Network
Definition
Define a Residual Network for a flow network with flow .
For each edge in with capacity and flow :
  • Forward Edge: (remaining available capacity).
  • Backward Edge: (capacity to push back/cancel existing flow).
Showing 8 of 20 cards in this deck.
Study All Now

Related Flashcard Sets

Explore similar study materials created by the community

Browse community decks