NUS · CS3230 · Design and Analysis of Algorithms

CS3230: ace the component, not just read the notes

Your complete guide to National University of Singapore's design and analysis of algorithms course. See where the marks are, work real practice questions, and study with an AI tutor that knows CS3230.

4 credit points Level 3000 undergrad Offered Semester 1 / Semester 2 Department of Computer Science

Sia generates CS3230 practice questions, walks through asymptotic analysis and recurrences step by step, and quizzes you on the material the component that weights most heavily.

Try a real exam-style question

Worked example

Multiple choice · solution revealed after you answer

Solve the recurrence T(n) = 2T(n/2) + n log n using the Master Theorem, or explain why it does not apply directly.

Worked solution

Compute n^{log_b a} = n^{log_2 2} = n.

Compare f(n) = n log n with n: it is larger, but only by a logarithmic factor, not by a polynomial factor n^ε.
Case 3 of the basic theorem needs polynomial separation, so none of the three basic cases applies.
The extended (CLRS 4th edition) form handles f(n) = Θ(n^{log_b a} log^k n) with k = 1, giving T(n) = Θ(n log² n). A recursion tree confirms: log n levels each costing about n log n.

The trap: Picking Θ(n log n) because f(n) 'looks like' the answer, or applying case 3 without checking the polynomial-separation condition. The exam rewards stating why a case does not apply. classic slip!

your whole grade
Where your grade comes from Coursework 40% · Quizzes 30% · Test 30%

One component decides 40% of your grade. No make-up session. This whole page is built around that.

Overview

What CS3230 is, and where it sits

CS3230 Design and Analysis of Algorithms is the core algorithms course of the NUS Computer Science curriculum, taught in Semester 1 AY2026/27 by Chang Yi-Jun, Steven Halim and Rahul Jain in three blocks of weeks. It assumes CS2040S and the discrete mathematics of CS1231S or MA1100, and cannot be taken on S/U.

The course splits into design and analysis. Design covers divide and conquer, randomised algorithms, dynamic programming, greedy algorithms, linear-time sorting and order statistics. Analysis covers asymptotic notation, recurrences and the Master Theorem, proofs of correctness, the comparison-sort lower bound, probabilistic analysis, amortised analysis and NP-completeness. Lectures run Friday 2-4pm with weekly VisuAlgo quizzes; 21 tutorial groups meet from Week 2.

Assessment is 30% continuous assessment (capped), a 30% midterm test on the Saturday of Week 7 and a 40% written final assessment. The continuous component is built from lecture quizzes, tutorial participation and the best four of five written assignments; the course page notes that most students score the full 30%, which makes the two tests the real grade discriminator.

How it differs from its first-year siblings. The published continuous assessment is designed to be maxed out: attend lectures, present in tutorials, do the assignments. What CS3230 actually grades is whether you can write a correct proof or a tight analysis under time pressure in the midterm and the final, which together carry 70%.

Always treat your own course outline and the exam timetable as authoritative.

Difficulty & time commitment

Is CS3230 hard, and how much time does it take?

CS3230 is manageable if you keep a weekly rhythm and treat the back half as the main event. The pattern is consistent: it starts gently and steepens, and the heaviest assessment is the part that separates grades.

Difficulty
3.6 / 5
Moderately hard. Gentle early, demanding back half. Hard to fail with steady work; a top grade takes consistent practice.
Coursework
100%
Coursework carries most of the grade. The heaviest single component is the component at 40%.
Weekly time
~10 hrs
Around 10 hours per week including class, across lectures, study and assessment.
Asymptotics, recurrences, correctness proofssteady
Divide and conquer, randomised algorithms, DP, greedysteep
Amortised analysis, reductions, NP-completenesssteep
Linear-time sorting and selection, revisionsteady

The difficulty curve and the assessment weighting point the same way: the back half is harder and worth more. Front-loading effort there is the highest-return decision in the course.

Is this course for you

Who tends to do well, and who tends to struggle

You will likely do well if

  • You write proofs comfortably from CS1231S and enjoy arguing why an algorithm is correct, not just that it works.
  • You attend or watch every lecture and do the VisuAlgo quiz — 2% is there for free.
  • You attempt every tutorial question before class and volunteer to present; 3% and a lot of exam practice.
  • You start each assignment early; five are set, the best four count, and there are no extensions.

You may struggle if

  • You treat the assignments as coding tasks; the submissions are written proofs and analyses.
  • You skip Week 1-2 asymptotics because they feel familiar; every later analysis question depends on them.
  • You leave reductions and NP-completeness to the last fortnight; the course flags them as the hardest final questions.
  • You rely on memorised recurrences instead of being able to solve a new one.
do this ↘
What top students do differently
  • Keep a running sheet of every recurrence pattern and the Master Theorem case it falls under.
  • For every algorithm covered, write down the invariant or the inductive claim and practise stating it in one sentence.
  • Work the published past midterm and final papers under time; the team publishes recent papers for its own runs.
  • Practise reductions in both directions: say which problem is known hard and which you are showing hard, and check the direction every time.

Syllabus

The 12 topics, week by week

The exam-weight marker on each topic shows where the marks concentrate. The amber topics carry the highest exam weight.

1

T1 · Asymptotic analysis

Week 1; CLRS ch. 1-3

Word-RAM model; formal definitions of O, Ω, Θ, o and ω; ranking functions.

2

T2 · Recurrences and the Master Theorem

Week 2; CLRS ch. 4

Telescoping, substitution, recursion trees and the three Master Theorem cases.

3

T3 · Proof of correctness

Week 3; tutorial 3

Loop invariants for iterative algorithms and induction for recursive ones.

4

T4 · Divide and conquer

Weeks 3-4; CLRS ch. 2, 4

Merge sort, binary search, fast exponentiation, peak finding, polynomial multiplication.

High exam weightQuiz me on divide →
5

T5 · Sorting lower bound and Quicksort analysis

Week 4; CLRS ch. 7-8

Decision trees and Ω(n log n); average case of deterministic Quicksort.

6

T6 · Randomised algorithms

Week 5; CLRS ch. 7

Indicator random variables, linearity of expectation, union bound, randomised Quicksort, Freivalds' algorithm.

7

T7 · Dynamic programming

Week 6; CLRS ch. 14

Fibonacci, LCS, knapsack, coin change, LIS, polygon triangulation; DP as DAG.

8

T8 · Greedy algorithms

Week 7; CLRS ch. 15

Fractional knapsack, Huffman coding, activity selection and exchange arguments.

9

T9 · Amortised analysis

Week 9; CLRS ch. 16

Aggregate, accounting and potential methods on counters, stacks and resizable arrays.

10

T10 · Problem reductions and intractability

Week 10; CLRS ch. 34

Polynomial-time reductions; vertex cover, independent set and the idea of hardness.

11

T11 · NP-completeness

Week 11; CLRS ch. 34

P, NP, NP-hard and NP-complete; SAT, 3-SAT, IS, VC, HS, SUBSET-SUM reductions.

12

T12 · Linear-time sorting and selection

Week 12; CLRS ch. 8-9

Counting and radix sort; Quickselect and median-of-medians; order-statistics trees.

How it's assessed

Assessment structure

ComponentWeightFormat & timing
Continuous assessment (capped): VisuAlgo lecture quizzes, tutorial participation, best 4 of 5 written assignments30%Twelve VisuAlgo lecture quizzes (up to 2%), tutorial participation (up to 3%) and five written assignments with the best four counted (about 7.5% each); the total exceeds 30% and is capped at 30%. Weeks 1-13. Capped at 30%; no assignment extensions or make-up.
Midterm test (120 minutes, pen and paper)30%Written test of 120 minutes covering Weeks 1-7 (asymptotics to greedy). No electronics except one non-programmable calculator. Saturday of Week 7 (3 Oct 2026). One make-up session for medical or approved reasons only.
Final assessment (150 minutes, pen and paper)40%Written assessment of 150 minutes on the whole course; open book, no electronic device except one calculator. Examination period (26 Nov 2026). No make-up session.
Continuous assessment (capped): VisuAlgo lecture quizzes, tutorial participation, best 4 of 5 written assignments30%
Twelve VisuAlgo lecture quizzes (up to 2%), tutorial participation (up to 3%) and five written assignments with the best four counted (about 7.5% each); the total exceeds 30% and is capped at 30%.
Midterm test (120 minutes, pen and paper)30%
Written test of 120 minutes covering Weeks 1-7 (asymptotics to greedy). No electronics except one non-programmable calculator.
Final assessment (150 minutes, pen and paper)40%
Written assessment of 150 minutes on the whole course; open book, no electronic device except one calculator.
  • The three components sum to 100 and no separate hurdle is published. The continuous component is capped at 30% even though the pieces add to more. Missing the midterm without medical or approved grounds forfeits it; the single make-up test is described as generally harder. There is no make-up for the final.
  • Midterm: 120 minutes, Weeks 1-7 material, with an easier dynamic-programming question flagged as likely. Final: 150 minutes across the whole course; the lesson plan flags greedy, amortised analysis and a reduction or NP-completeness question as expected, with the reduction usually the hardest. Recent past papers are published on the course site for the teaching team's own semesters.
read this! If you read nothing else

This is a coursework course. Coursework carries 100% of the grade and the final assessment (150 minutes, pen and paper) is the single heaviest piece at 40%, so steady work across the semester decides your result more than any one sitting. No make-up session.

Final exam timing: During the examination period. Confirm the exact date and venue on your exam timetable.

How to actually pass it

A weekly rhythm, two checklists, and the traps to avoid

The course rewards consistency over cramming, and practice over re-reading. Here is the loop that works, then what to have nailed before each exam.

The weekly loop

Friday lecture
Do the VisuAlgo quiz in the lecture window; the daily LeetCode task list is the applied version of each week.
Before the tutorial
Attempt all published tutorial questions; prepare to present one.
Each fortnight
Submit the assignment early enough to ask for hints in Discord after a serious two-hour attempt.
Week 6-7
Rehearse Weeks 1-7 with the published past midterm papers before the Saturday test.

Before the mid-semester checklist

  • Prove a tight Θ bound for a function or rank a list of functions by growth.
  • Solve a recurrence three ways and match it to a Master Theorem case.
  • Write a loop-invariant proof for a short iterative algorithm.
  • Compute an expected running time using indicator random variables.

Before the final heaviest topics

  • Formulate a DP with a clear state, transition and base case, and give its complexity.
  • Give an exchange argument for a greedy choice.
  • Run an amortised analysis with the potential method.
  • Write a polynomial-time reduction between two named NP-complete problems, in the correct direction.

The mistakes that cost marks

01

Reduction in the wrong direction. To show X is hard you reduce a known hard problem to X, not X to the hard problem. The course names this as the classic final-exam error.

02

Using the divergence-style shortcut. In analysis questions, showing an upper bound is not showing a tight bound; state both O and Ω when Θ is asked.

03

Missing the assignment window. There are no extensions; the best-four-of-five rule is the only buffer.

Teaching team

Who teaches CS3230

The bios below are factual. We do not rate lecturers; any star ratings are submitted by students who have taken CS3230.

Lecturer, Weeks 1-5

Chang Yi-Jun

Student ratingNo student ratings yet
Course coordinator and lecturer, Weeks 6-8

Steven Halim

Student ratingNo student ratings yet
Lecturer, Weeks 9-13

Rahul Jain

Student ratingNo student ratings yet
Tutor and consultation, from Week 4

Rucha Ravi Kulkarni

Student ratingNo student ratings yet

Teaching team as listed in the course materials reviewed. AskSia does not rate lecturers; star ratings are submitted by students who have taken CS3230.

Formula & concept sheet

The vocabulary and formulas you must own

Big-O, Ω, Θ
Upper, lower and tight asymptotic bounds on a function's growth.
Master Theorem
A three-case rule for recurrences of the form T(n) = aT(n/b) + f(n).
Loop invariant
A property that holds before and after each iteration, used to prove correctness.
Indicator random variable
A 0-1 variable whose expectation equals a probability; the tool for expected-time analysis.
Optimal substructure
The property that an optimal solution contains optimal solutions to subproblems, required for DP.
Exchange argument
A proof that swapping an optimal choice for the greedy choice never hurts.
Potential method
Amortised analysis using a potential function that pre-pays for expensive operations.
Polynomial-time reduction
A transformation of instances of one problem into another that runs in polynomial time.
NP-complete
A problem in NP to which every NP problem reduces in polynomial time.
Median of medians
The deterministic worst-case linear-time selection algorithm.

Set texts

The prescribed reading

The syllabus references map straight onto these.

Introduction to Algorithms

.

Algorithm Design

.

Where it fits

Prerequisites, related courses & why it matters

Prerequisites: CS2040S (or equivalent) and CS1231S or MA1100. 4 units; not S/U-able; offered in Semester 1 and Semester 2, with the two semesters kept similar by the teaching team.

Why it matters beyond the grade. CS3230 is the algorithms course that technical interviews and CS4234-level optimisation courses assume; its proof and analysis habits carry into any algorithmic or research role.

FAQ

Frequently asked questions

Is CS3230 hard?

Moderately hard on the six-factor rubric. The mathematics is the heaviest in the CS core and 70% sits in two written tests, but the continuous assessment is designed to be maxed out and the teaching team says failing is hard if you put in the effort.

What is the assessment breakdown?

Continuous assessment 30% (capped: lecture quizzes up to 2%, tutorial participation up to 3%, best four of five assignments at about 7.5% each), midterm test 30% and final assessment 40%, as published on the course website for S1 AY2026/27.

Who teaches it?

In S1 AY2026/27 the lecturers are Chang Yi-Jun (Weeks 1-5), Steven Halim (Weeks 6-8, course coordinator) and Rahul Jain (Weeks 9-13), with Rucha Ravi Kulkarni joining for tutorials and consultation from Week 4.

Can I S/U or audit CS3230?

No to both. It is a core course; students who miss out on a place are asked to take it in the following semester.

Do I need a textbook?

Not required. The main reference is Introduction to Algorithms (CLRS), 4th edition, with Kleinberg and Tardos and Competitive Programming 4 as secondary references.

What are the prerequisites?

CS2040S (or an equivalent data structures and algorithms course) and CS1231S or MA1100; the course page stresses that it is heavy on mathematics.

Study CS3230 with Sia

Work through asymptotic analysis, recurrences, proof of correctness and the rest of the course with a tutor that knows it and quizzes you on the topics the assessments weight most heavily.

Start studying with Sia