UW-Madison · CS400 · Programming III

CS400: ace the component, not just read the notes

Your complete guide to University of Wisconsin-Madison's programming iii course. See where the marks are, work real practice questions, and study with an AI tutor that knows CS400.

3 credit points Intermediate undergrad Offered Fall / Spring Department of Computer Sciences

Sia generates CS400 practice questions, walks through balanced search trees and hash tables step by step, and quizzes you on the material the component that weights most heavily.

Spot the bug

Find what is wrong

Multiple choice · the fix is revealed after you answer

A social network stores 10 million users. You must repeatedly answer: is there a connection path between user A and user B? Which approach fits best?

The fix

Identify what the question is actually asking: reachability, which is a property of paths rather than of individual records.

Sorting and binary search find a user; they say nothing about connectivity. A balanced tree has the same limitation.
Hashing all connected pairs answers direct connection only, and the number of reachable pairs is far larger than the number of edges.
Modelling as a graph and traversing from A answers reachability directly, in time proportional to the vertices and edges visited.

The trap: Reaching for the structure that indexes records rather than the one that represents relationships. The course's framing question is which class of problem requires which data type, and reachability is the canonical case where the answer is a graph rather than a table or a tree. classic slip!

Overview

What CS400 is, and where it sits

COMP SCI 400 is the third course in the UW-Madison programming fundamentals sequence. It covers balanced search trees, graphs and graph traversal algorithms, hash tables and sets, and complexity analysis, including which classes of problem require which data type.

The practical half is what distinguishes it. Students design and implement a medium-sized program in high quality professional code, demonstrating current language features, tools and conventions. Additional topics may include inheritance and polymorphism, anonymous inner classes, lambda functions and performance analysis to find and optimise critical code blocks. The catalogue states the course introduces industry standards for writing maintainable code.

The published outcomes make the professional emphasis explicit: selecting and using standard development tools including shells, source control and build systems; making and describing high and low-level design decisions; designing and categorising types of tests and choosing between them by scenario; and reading, analysing and reviewing programs to evaluate functionality, performance and maintainability. Reviewing someone else's code is an assessed skill here, not an afterthought.

How it differs from its first-year siblings. COMP SCI 400 completes the 200 to 300 to 400 sequence and is an alternative gate course for declaring the major, alongside COMP SCI 300 and COMP SCI/E C E 354.

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

Difficulty & time commitment

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

CS400 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.8 / 5
Hard. Gentle early, demanding back half. Hard to fail with steady work; a top grade takes consistent practice.
Coursework
0%
Coursework carries most of the grade. The heaviest single component is the component at 0%.
First thirdBalanced search trees and hashing
Middle thirdGraphs and traversal algorithms
Final thirdThe medium-sized team project

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 are comfortable with source control and the command line, or willing to become so quickly.
  • You can justify a design decision, not merely make one.
  • You read other people's code carefully, since reviewing it is assessed.
  • You manage a medium-sized project without leaving integration to the end.

You may struggle if

  • Your COMP SCI 300 foundations are shaky; nothing here is re-taught.
  • You avoid tooling and want to work only in an IDE's default setup.
  • You treat graph algorithms as things to recognise rather than implement.
  • You leave the project until the analytical material is also peaking.
do this ↘
What top students do differently
  • Implement each graph algorithm once from scratch before using a library version.
  • Write the design rationale for your project as you go; the outcome asks you to describe decisions.
  • Use branches and commits properly from week one, since tooling is examined.
  • Review a classmate's code and write the review; it sharpens your own structure choices.

Syllabus

The 9 topics, topic by topic

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

T1

T1 · Balanced search trees

Course description

Keeping tree height logarithmic so worst-case performance is guaranteed rather than hoped for.

T2

T2 · Hash tables and sets

Course description

Expected constant-time access, the cost of collisions, and the set abstraction built on top.

T3

T3 · Graph representations

Course description

How a graph is stored, and the complexity consequences that follow from the choice.

T4

T4 · Graph traversal algorithms

Learning outcome 3

Systematic visiting of a graph, and the applications each traversal order unlocks.

T5

T5 · Complexity analysis and problem classes

Course description

Matching a problem to the data type it needs, which is the course's organising question.

T6

T6 · Development tooling: shells, source control, build systems

Learning outcome 1

A published outcome in its own right, and the part most students have never been assessed on before.

T7

T7 · Design decisions, high and low level

Learning outcome 2

Not only making design choices but describing and defending them, which the medium-sized project forces.

T8

T8 · Test design and categorisation

Learning outcome 5

Choosing the type of test that fits the scenario rather than writing more of the same kind.

T9

T9 · Code review for performance and maintainability

Learning outcome 7

Reading and evaluating existing programs, which is assessed here and is most of professional practice.

How it's assessed

Assessment structure

If you read nothing else

A component-by-component weighting breakdown is not published for this course. Rather than estimate one, we publish only what the course itself states. Check your current course outline for the exact percentages.

No component weighting is published. The university catalogue publishes course description, credits, requisites, course designation and learning outcomes, but not assessment weights, and instructor syllabi carrying them are set per section and per term. Rather than estimate a breakdown or reuse a superseded one, none is asserted here. Check the syllabus your instructor posts for this term. Not published in the catalogue. Format is set per section by the instructor.

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

Before lecture
Review the structure or algorithm being covered so lecture is about trade-offs.
Same week
Implement it yourself and measure it on a non-trivial input.
Same week
Commit work in small, described increments rather than one large push.
Every fortnight
Re-derive the complexity of an earlier algorithm and check it against your measurements.

Before the mid-semester checklist

  • Balanced search trees and why balance matters
  • Hash tables, collisions and sets
  • Graph representations and their trade-offs
  • Development tooling: shell, source control, build

Before the final heaviest topics

  • Graph traversal algorithms and their applications
  • Matching problem classes to data types
  • Design decisions at high and low level, described
  • Test categories and choosing between them
  • Reviewing code for performance and maintainability

The mistakes that cost marks

01

Choosing an indexing structure for a relationship problem. Trees and hash tables find records; graphs represent connections. The course is built around telling them apart.

02

Ignoring the tooling outcome. Shells, source control and build systems are named in the first learning outcome, which means they are assessed.

03

Leaving integration to the final week. A medium-sized program fails at the seams, and the seams are discovered late by teams that build in isolation.

04

Writing tests of one kind only. The outcome asks you to categorise tests and pick types by scenario, not to produce volume.

Formula & concept sheet

The vocabulary and formulas you must own

Balanced search tree
A search tree that maintains logarithmic height, guaranteeing worst-case performance.
Hash table
A structure giving expected constant-time access by mapping keys to positions.
Set
A collection without duplicates, typically built on hashing or on a search tree.
Graph
Vertices and edges representing entities and relationships between them.
Adjacency representation
How a graph is stored, which determines traversal and lookup complexity.
Traversal
Systematically visiting a graph's vertices, the basis of most graph algorithms.
Source control
Tracking and merging changes to code over time; named in the course outcomes.
Build system
Tooling that compiles and assembles a project reproducibly.
Maintainability
How readily code can be understood and changed later, assessed here through code review.

Common acronyms: {'term': 'QR-B', 'def': 'Quantitative Reasoning Part B designation'} · {'term': 'ADT', 'def': 'Abstract data type'} · {'term': 'L&S', 'def': 'College of Letters & Science'}.

Where it fits

Prerequisites, related courses & why it matters

Requires COMP SCI 300, graduate or professional standing, or declaration in the Capstone Certificate in Computer Sciences for Professionals.

Why it matters beyond the grade. Graphs, hashing and balanced trees are the backbone of technical interviews, and the tooling and code review outcomes are the parts employers actually observe on day one.

FAQ

Frequently asked questions

What is the prerequisite?

COMP SCI 300, or graduate/professional standing, or declaration in the Capstone Certificate in Computer Sciences for Professionals.

What makes COMP SCI 400 different from 300?

Scale and professionalism. The data structures are harder, and the course requires designing and implementing a medium-sized program in high quality professional code, using standard tools including source control and build systems.

Is code review really assessed?

Yes. One published outcome is reading, analysing and reviewing programs to summarise and evaluate their functionality, performance and maintainability.

Does it count for major declaration?

It is one of the three courses in which a BC or higher can satisfy the introductory programming requirement for declaring the major, alongside COMP SCI 300 and COMP SCI/E C E 354.

How is it graded?

No weighting is published in the catalogue; assessment is set per section.

Is it still running?

Yes. The catalogue records it as last taught in Summer 2026.

Study CS400 with Sia

Work through balanced search trees, hash tables, graph representations 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