CS2040C - Data Structures and Algorithms (C++)


This module introduces students to the design and implementation of fundamental data structures and algorithms. The module covers basic data structures (linked lists, stacks, queues, binary heaps, hash tables, binary search trees, and graphs), searching and sorting algorithms, basic analysis of algorithms, and very basic object-oriented programming concepts (more details of OOP are in CS2030).

The programming language used for this module is C++ (as of 2022, we still use C++17).

Note: This introductory message will not be prominent the next time you visit this URL again. This behavior is normal. You can view it again by scrolling to the top of this page.

Course Registration

Steven teaches CS2040C (NOT CS2040 — contact Dr Chong Ket Fah — nor CS2040S — contact A/Prof Seth Lewis Gilbert) in S2 AY 2021/22 (Jan-Apr 2022). Steven already had enough experiences teaching CS2040/C/S module in previous 4 AYs (eight times :O; 4 very good, 2 good, 2 "around average"). This S2, there is a major shocking change where the majority of 200 pax Computer Engineering (CEG) students will take CS2040C in their sem 3 (S1 AY 2022/23 — also with me) instead of THIS S2 AY AY2021/22. Therefore, we probably have an overkill lineup of teaching staff (me and Dr Alan Cheng Holun will co-teach again).

As of 20 Jan 2022, this class has 143 students. PS: This time, there are about ~16 exchange students (overseas SEP is resumed starting this S2).

Some other facts:

  1. Steven uses flipped classroom, machine-teach-(and-auto-test)-students, and in-class live discussion of (hard)er problems in his CS2040/C/S classes many times in last 4 AYs (AY 2017/18 - present). His teaching feedback ratings for those offerings vary in [4.2 (just slightly above average)..4.8 (good)] bracket out of maximum 5.0.
  2. On top of teaching CS2040/C/S eight times so far (2017-2021), Steven has also taught other similar modules: CS2020 once (2011), CS2010 six times (2011-2016), and CS1020E once (2016).
  3. Teaching staffs:
    (Senior) Lecturer: Dr Steven Halim, the key man behind VisuAlgo that will be used very extensively in this module.
    Moreover, he is now free from the heavy IOI 2020 and IOI 2021 hosting duties, thus he can now devote more time into his teachings.
    Due to the still ongoing COVID-19 pandemic, all e-lectures (involving ≥ 50 students, like the expected size of this class) will be via Zoom and recorded.

    (out of 5.0)
    (SoC avg ~4.1)
    Jan-May 22
    ≥ 50%
    Aug-Dec 21
    Jan-May 21
    Aug-Dec 20
    Aug-Dec 19
    Jan-May 19
    Module feedback ≥ 4.1 (at least this) 4.2 == (target achieved) 4.2 (co-teach with Dr Alan) 3.8 (COVID-19+IOI 20) 4.0 == 4.0 (v large)
    Module difficulty ≤ 4.1 (co-teach with Dr Alan again) 4.2 (back to reasonable level) 3.9 (easiest; with Dr Alan) 4.6 (COVID-19+IOI 20) 4.2 4.0
    Steven's teaching ≥ 4.3 (at least this) 4.5 (target achieved) 4.4 (co-teach with Dr Alan) 4.3 (COVID-19+IOI 20) 4.4 4.2 (v large)
    Date, Time Zoom Session (#Stu/#Cap) No Tutor
    1/Mon, 1700-1800
    (1h consultation slot)
    Recurring Link (free and easy) - Fidella Widjojo
    1/Mon, 1500-1600
    (1h consultation slot)
    Recurring Link (free and easy) - Audrey Felicio Anwar
    2/Tue, 1100-1200
    (1h consultation slot)
    Recurring Link (free and easy) - Tang Ethan Yidong
    2/Tue, 1900-2000
    (1h consultation slot)
    Recurring Link (free and easy) - Nyamdavaa Amar
    3/Wed, 1000-1200 COM1-B-112 (PL1) (19/19) 01 Muhammad Ayaz Dzulfikar
    3/Wed, 1000-1200 Recurring Link (19/19) 02 Nyamdavaa Amar
    3/Wed, 1200-1400 COM1-B-112 (PL1) (20/20) 04 Ammar Fathin Sabili
    3/Wed, 1200-1400 Recurring Link (20/20) 05 Tang Ethan Yidong
    3/Wed, 1400-1600 COM1-B-112 (PL1) (17/19) 07 Audrey Felicio Anwar
    3/Wed, 1400-1600 Recurring Link (10/19) 08 Edbert Geraldy Cangdinata
    3/Wed, 1600-1800 COM1-B-112 (PL1) (19/19) 10 Fidella Widjojo
    3/Wed, 1600-1800 Recurring Link (19/19) 11 Eric Bryan
    4/Thu, 1000-1100
    (1h consultation slot)
    Recurring Link (free and easy) - Eric Bryan
    4/Thu, 1400-1600
    (2h consultation slot)
    Recurring Link (free and easy) - Muhammad Ayaz Dzulfikar
    5/Fri, 1700-1800
    (1h consultation slot)
    Recurring Link (free and easy) - Ammar Fathin Sabili
    5/Fri, 2000-2100
    (1h consultation slot)
    Recurring Link (free and easy) - Edbert Geraldy Cangdinata

    List of TAs:

    1. Ammar Fathin Sabili (PhD student)
    2. Muhammad Ayaz Dzulfikar (PhD student)
    3. Audrey Felicio Anwar
    4. Fidella Widjojo
    5. Edbert Geraldy Cangdinata (Discord PIC — will monitor class Discord frequently)
    6. Nyamdavaa Amar
    7. Tang Ethan Yidong
    8. Eric Bryan
  4. Have you passed (or exempted from) CS1010 (or its variants)? You have to...
  5. Have you taken CS1020/CS1020E/CS2010/CS2020? You cannot take CS2040/C/S if you have taken similar/older module(s) that have huge degree of overlap with this module.


This is what you will learn if you take CS2040/C/S taught by Steven:

Course Registration Additional FAQ

If you have any important questions regarding this module, email stevenhalim at gmail dot com. Relevant answers will be posted here to reach wider audiences.

Q: Will CS2040C S2 AY 2021/22 be 100% online?
A: Yes for the lecture component (≥ 50 students). However, we will run 4 F2F lab sessions with capacity 19 pax each at PL1 (primary mode) and 4 other E-Learn lab sessions, also with capacity 19 pax each. Practical Exam (with proper onsite proctoring) on Week 11 will be onsite. Final is still expected to be an online LumiNUS Quiz.
Q: Will there be a Practical Exam (PE) for your version of CS2040/C/S?
A: Yes, once only, on Week 11 (everything up to just before graph data structure).
We will do the scary-sounding Open Internet PE but with onsite proctoring. This time, students who are still overseas will be deemed as absent, so plan accordingly.
Q: Open Internet PE sounds scary... Will there be a make up PE if I am sick/underperform...?
A: Yes. Steven is aware that many students are still at learning stage. Those who are absent from the official ones for valid reason (clash with another official NUS module, MC, Bereavement of immediate family member, representing NUS for official event — but many will be cancelled/postponed due to COVID-19) and a few bottom X (TBC) students will be invited for the make up PE sometime during study week.
Q: Will this module be graded using Bell curve?
A: For this S2 AY 2021/22 version, as the class size is 143 pax, we will use Bell Curve.
Q: I am from CS1101S (subset of JavaScript)/CS1010S or CS1010E (Python)/other modules that do not use C/C++, should I pick up C++ on my own during this early January 2022?
A: Yes, that is a very good idea. We will only review basic C++ in the first few weeks of this module and then Steven will encourage you to self-learn C++ along the way. A few early admin emails will be sent to students who are already enrolled by early January 2022 to start this process early.
Q: What Integrated Development Environment (IDE) that we will use in your version of CS2040/C/S?
A: The choice of IDE is "up to you but" we recommend Visual Studio that is confirmed available in various PLs in NUS SoC. But since PE for this semester is likely using the same BYOB (Bring Your Own Device) style, then you are free to use any C++ IDE that you are most comfortable with.
Q: Do I have to buy any textbook for this course?
A: Generally, no. But my Competitive Programming book: CP4, Book 1 (@ NUS co-op (24.6 SGD nett, no shipping cost), @ SIMCC e-Store (29.9 SGD nett, no shipping cost), and @ lulu.com (19.99 USD+shipping cost+10-14 days of shipping)) (actually for CS3233), should be a good book to have. The answers for many of my test questions may be inside that book. The problem is... I discuss over ~3600+ problems in that book, near impossible to solve them all in just one semester.
Q: Can I S/U this module if I am a freshman when I take this module?
A: No, as this is a level-2 core module. CS2040/C has CS1010 as pre-requisite and according to Registrar's Office: "The S/U option will apply to all Level 1000 modules (with or without pre-requisites) and Level 2000 modules without other NUS modules as pre-requisites, unless otherwise stipulated by the Faculties/Departments". So factor this information when taking this module.
Q: I heard from my friend/senior that your version of CS2040/C/S is a flipped classroom module?
A: You heard that correctly. This December 2021, Steven and three his FYP students is working hard at the background to continuously improve his 24/7 electronic clone, VisuAlgo, to be able to explain basic data structures and algorithms concepts covered in CS2040/C/S as clear as possible to first timer (and to automatically test students about these basic concepts). This will free the precious 2+1h (effective 95+45m = 140m per week to discuss the harder/deeper part of the syllabus and to do live demonstration of how those data structures and algorithms can be used to solve (real life, but sometimes fictional) programming problem. This will also help Steven to scale himself (one person) to handle much larger algorithm class (CS2040/C/S are projected to grow bigger in future AYs as NUS SoC freshmen intake increases).
Q: What are the potential changes that you will apply to CS2040/C/S in S2 AY 2021/22 compared to your eight earlier runs of this module?
A: These are the potential changes due to COVID-19, the CEG cohort shifted to Sem 3 bombshell, and co-teaching with Dr Alan:
  1. NUS @ Kattis is used this time, instead of Coursemology (it is now Dr Alan's turn to try full Kattis style).
  2. The PE difficulty level of S1 AY 2021/22 is 'good enough', so the standard will be kept at that, Steven will oversee the preparation of this PE.
  3. Midterm Quiz and Final Assessment format will be simpler (MRQs or short fill-in-the-blanks, and only a few manually-graded essays using Luminus Quiz + Zoom e-proctoring) and will be 'not that hard', as per S1 AY 2021/22 level, both Steven and Alan will co-prepare this, with Dr Alan focusing more on the Final.
  4. Another iterative enhancement to various VA e-Lecture slides with the aim to 'make this a printed book' sometime within this AY 2021/22.
  5. Revival of VisuAlgo test mode, there will be new questions that only appear during 'test mode' that nobody can train for; VA OQ will be used at least twice this time.
  6. Steven will keep most of Kattis exercise problems intact this time as he is focusing on other things in 2022.
  7. Steven will balance the discussion of detailed data structures/algorithms with its C++ STL counterpart, as with Dr Alan's S2 version.
  8. Dr Alan will take over the Tuesday 2h lectures from Week 07-end while Steven will only make appearances on Wednesday 1h lectures in that period (to focus only on the implementation side).
  9. All others are planned to be kept roughly constant.

Note: This course registration section will not be prominent from Week 1 of S1 AY 2021/22 onwards. This behavior is normal. You can view it again by scrolling to the top of this page.


Date News

Lesson Plan

Week Lecture,
Every Tue 12-2pm and
Every Wed 8-9am
All online, from Wk01
(VA e-Lecture Slides, plus
Zoom Q&A sessions;
at least for the first 6 weeks)
Tutorial+Lab Combo,
Wed (4 F2F,
2, 3, or 4 E-Learning)
From Wk03
Interesting Problem Set
@ Home
Every ~Two Weeks
~6++ hours/set
From Wk02
Cells with course material that have not been updated are highlighted with pink color, past classes more than one week ago are hidden so that we can focus on the current and future classes, but you can restore them by clicking 'Show Past' button above, future classes are not highlighted
Bef Mon,
10 Jan
Not started, but please revise your CS1010
(Steven assumes that all? of you have taken
or exempted from this module/its variants)

Register at Kattis (use full name as in Matric card),
read C++ specific instructions @ Kattis,
and solve the selected optional Online Judge (OJ)
Problem Set 0 (PS0) by yourself (CS1010 level):
(solving many 'trivial problems' from this set
---trackable by Steven, indirectly tells Steven
about your CS1010 rough grade)
Not Started PS0: Easy C++/coding challenges
(29 Dec-11 Jan)
obviously not graded
10-14 Jan
01a. Course Admin, (Re-)Introduction to C++
Setting the tone for a flipped classroom plus 100% ONLINE module
VisuAlgo + this Private LumiNUS + Kattis (NUS) + Kattis (open)
Basic C/C++ review/new feature introduction
Kattis problem(s) discussed today:
ofugsnuid (introducing automated partial marking @ Kattis; C++ std::vector; std::reverse)
keylogger (introducing vector of C++ std::strings)

01b. (Re-)Introduction to C++ (continued)
Kattis problem(s) discussed today:
vectorfunctions (more about C++ functions (const, &) and std::vector)
rankproblem (a new List ADT task; iota; std::vector insert and erase operations)

Reminder: Read summary on algorithm analysis (Slide 6 to 6-11)
before Lecture 02a
Not Started PS0
Due: Tue, 11 Jan 22, 01.29pm

PS1: Basic C++
This is now graded
Out: Tue, 11 Jan 22, 01.30pm
Mentioned at the end of the first lecture
17-21 Jan
02a. Analysis of Algorithms (Slide 6 to 6-11)
(Kattis) problems discussed:
rankproblem (NEW: recoded in C++ class)
Live SpeedTest.cpp | py | java demo (measure runtime, count # of operations, vs asymptotic analysis)
thanos (Analysis: exponential growth, logarithmic steps)
heirsdilemma (brute force math; O(1M possibilities * 6 digits) in the worst case - small enough)

Reminder: Read sorting e-Lecture slides (Slide 1 to 9-3)
before Lecture 02b

02b. Sorting (Slide 1 to 9-3)
C++ STL algorithm: std::sort, std::stable_sort
Kattis problem(s) discussed:
mjehuric (bubble sort simulation),
height (insertion sort simulation),
sortofsorting (NEW: custom comparator, C++ STL std::stable_sort vs std::sort)

Last flipped classroom reminder: Read ALL sorting e-Lecture slides
before Lecture 03a
Started early
because of CNY Day 2 on Week04

e-Consultation starts
Review demo code so far, focusing on
C++ STL (algorithm, std::vector, std::string)

T01+L01: tut01.pdf
OOP review (List ADT/ListArray)
PS1 Discussion (algorithmic)
Due: Sat, 22 Jan 22, 07.59am

PS2: Sorting-related Problems
Out: Sat, 22 Jan 22, 08.00am
24-28 Jan
03a. Sorting (until end)
O(N log N) sorting algorithms: Merge and (Randomized) Quick Sort
See the details at SortingDemo.cpp | py | java
Special-purpose O(N) sorting algorithms: Counting and Radix Sort
Other topics of sorting e-Lecture
Sorting Online Quiz (medium)
Kattis problem(s) discussed:

03b. List ADT: (Singly) LL (Slide 1 to 3-22)
Introducting List ADT, (resizeable) array implementation, and SLL implementation
SLLDemo.cpp | py | java
C++ STLs: std::forward_list (an SLL), std::list (a DLL)
T02+L02: tut02.pdf
Sorting Application(s),
Sorting, mini experiment,
ADT re-introduction,
List ADT (array vs std::vector),
PS1 Debrief (short),
VA OQ demo (sorting),
PS2 Discussion (algorithmic)
PS2, continued
31 Jan-04 Feb
CNY Reunion Dinner on Mon, 31 Jan
CNY Day 1 on Tue, 01 Feb
CNY Day 2 on Wed, 02 Feb
CS2040C lectures+labs this week are cancelled

Due: Sat, 05 Feb 22, 07.59am

PS3: List-related Problems
Out: Sat, 05 Feb 22, 08.00am
07-11 Feb
05a. Stack/Queue/Deque ADT (DLL) (until end)
Focus on Stack, Queue, DLL, Deque
Showing the implementations of MyStack and MyQueue (extension of SLLDemo)
Plus a few other LL technicalities
C++ STLs: std::stack, std::queue, std::deque (actually not a DLL)
Linked List Online Quiz (medium)

05b. Priority Queue (PQ) ADT: Binary Heap (Slide 1-6)
Introducing PQ ADT
Introducing basic Binary Heap structure and its Insert+ExtractMax operations
T03+L03: tut03.pdf
List/Stack/Queue/Deque ADT,
Linked List, mini experiment,
PS2 Debrief (short),
C++ STL (std::list/std::stack/std::queue/std::deque),
VA OQ demo (list),
PS3 Discussion (algorithmic)
PS3, continued
14-18 Feb
06a. Priority Queue (PQ) (until end)
Discussing other PQ ADT details and Binary Heap implementation
BinaryHeapDemo.cpp | py | java
C++ STL: std::priority_queue, std::partial_sort
See priority_queue.cpp at GitHub repo of CPbook website
Binary Heap Online Quiz (medium)
Kattis problem(s) discussed:
rationalsequence3 (related to binary heap indexing)
Last 30m: VisuAlgo Online Quiz 1 (4%)

06b. Midterm Quiz (10%)
? essay boxes (all manual grading)
All easier questions would have been asked on 15 Feb
45 minutes (8.05-8.50am SGT)
With Zoom e-proctoring
For first year students, see e-Exam SOP
Material: Up to PQ (L05ab on Week 05 + T04+L04 on Week 06)

Midterm Test Past Papers:
AY 2017/18: S1-midterm.pdf, S2-midterm.pdf, S4-hard.pdf,
AY 2018/19: S1-midterm.pdf (Prof Gary), S2-midterm.pdf,
AY 2019/20: S1-midterm.pdf, S2-midterm.pdf (Dr Alan, N/A),
AY 2020/21: S1-midterm.pdf, S2-midterm.pdf (Dr Alan + myself, N/A),
AY 2021/22: S1-midterm.pdf (our paper).

T04+L04: tut04.pdf
Binary Heap,
Additional ADT PQ Operations,
C++ STL (std::priority_queue),
Max-Min conversion,
VA OQ demo (heap),
PS3 Discussion (algorithmic)
Due: Sat, 19 Feb 22, 07.59am

PS4: PQ/HashTable-related Problems
Out: Sat, 19 Feb 22, 08.00am
Recess Week, 19-27 Feb 2022
We can take a break this week :)
But if possible, read Hash Table and BST e-Lecture slides by yourself first...
28 Feb-04 Mar
07a. Table ADT part 1: Hash Table (until end)
TBC by Dr Alan

07b. Union-Find Disjoint Sets (all slides)
Live Quick Recap with VisuAlgo
Kattis problem(s) discussed:
unionfind (basic UFDS task)
PS: UFDS will only be discussed in Tut08 later
T05+L05: tut05.pdf
Midterm Quiz/first half review,
Basic hashing concepts,
PS3 Debrief (short),
Hands-on (2 tasks),
PS4 Discussion (algorithmic)
PS4, continued
07-11 Mar
08a. Table ADT part 2: BST + AVL Tree (until end)
TBC by Dr Alan

08b. Implementations of bBST and its applications
BST + AVL Tree Online Quiz (medium),
BSTDemo.cpp | py | java,
AVLDemo.cpp | java,
C++ STLs: std::set, std::map, std::multiset, std::multimap
See map_set.cpp at GitHub repo of CPbook website
Kattis problem discussed:
kattissquest (DS implementation exercise)
T06+L06: tut06.pdf
Table ADT 1 - unordered,
Hash Table issues,
C++ STL (std::unordered_map) (short),
C++ STL (std::unordered_set) (optional),
The (unordered) multimap/multiset versions (optional),
VA OQ demo (hashtable),
PS4 Discussion (algorithmic)
Due: Sat, 12 Mar 22, 07.59am

PS5: Table/Graph-related Problems
Out: Sat, 12 Mar 22, 08.00am
14-18 Mar
09a. Graph DS (all slides)
TBC by Dr Alan

09b. Implementations of graph DS and its applications
Graph DS Online Quiz (medium),
No built-in C++ STL container | Python standard library | Java API,
See graph_ds.cpp at GitHub repo of CPbook website,
Kattis problem discussed:
flyingsafely (for a 30s jaw-dropping moment)
T07+L07: tut07.pdf
Table ADT 2 - ordered,
BST/AVL advanced stuffs: Select and Rank,
PQ ADT alternative implementation,
Comparison with Table ADT 1,
unordered vs ordered,
C++ STL (std::map) (short),
C++ STL (std::set) (optional),
The multimap/multiset versions (optional),
PS4 Debrief (short),
VA OQ demo (bst,avl)
PS5 Discussion (algorithmic)
PS5, continued
Those who miss Midterm Quiz due to VALID reasons (valid Medical Certificate; representing NUS for an official event; bereavement of immediate family member)
and those who want to retake (especially bottom X students) can take make up midterm quiz around Week 09 (TBC).
Material: Now up to Week 07 stuffs, i.e., Hash Table may be included (review Midterm Quiz solutions on Week 07 too), and clearly harder than the original Midterm Quiz...
Note that there is no more make up of make up :O...
21-25 Mar
10a. Graph Traversal (DFS/BFS) (all slides)
TBC by Dr Alan

10b. Implementations of DFS/BFS and their applications
DFS/BFS Online Quiz (medium)
No built-in C++ STL algorithm | Python standard library | Java API,
See dfs_cc.cpp, UVa00469.cpp, and bfs.cpp at GitHub repo of CPbook website,
Kattis problem discussed:
reachableroads (DFS (/BFS) introduction, count #CC)
T08+L08: tut08.pdf
Graph DS Review,
Some Graph Properties Discussion,
Graph DS Conversion Exercise,
Graph Modeling exercise 1,
DFS/BFS Review,
UFDS Review,
Custom graph DS implementation review,
VA OQ demo (graphds,dfsbfs),
PS5 Discussion (algorithmic)
Due: Sat, 26 Mar 22, 07.59am

PS6: Graph-related Problems
Out: Sat, 26 Mar 22, 08.00am
28 Mar-01 Apr
11a. SSSP Problem: BFS (unweighted) (slide 1 to 6-3)
TBC by Dr Alan

Practical Exam (15%)
Timing: Tue, 29 Mar 2022, 6.30-8.30pm (120m)
(onsite; venue TBC)
PS: The version from last S1 AY 2021/22 (the level will be like this)
Details TBA.
Open Internet.

11b. PE upsolve by Steven
T09+L09: tut09.pdf
DFS/BFS advanced stuffs,
Cycle, Toposort++, (Floodfill/CC),
Modeling exercise 2 (time permitting),
PS4 Debrief (short),
Hands-on/PE preparation
PS6, continued
04-08 Apr
12a. SSSP continued: Dijkstra's (until end)
TBC by Dr Alan

12b. Implementations of SSSP algorithms and their applications
No built-in C++ STL algorithm | Python standard library | Java API,
See bellman_ford.cpp, bfs.cpp (again), dijkstra.cpp at GitHub repo of CPbook website,
SSSP Online Quiz (medium)
Kattis problem discussed:
modulosolitaire (BFS demo on an implicit graph)
shortestpath1 (that Dijkstra's implementation is easy; both versions)

NUS Online Teaching Feedback System opens this Friday
T10+L10: tut10.pdf
Bellman-Ford, BFS, and
Modeling exercises 3,
VA OQ demo (dfsbfs,sssp),
Tips for OQ preparation,
PE upsolve (high level only; 100/100 code not shown),
PS6 Discussion (algorithmic)
PS6, continued
11-15 Apr
13a. MST (until end)
TBC by Dr Alan

13b. TBC by Steven
Last Lecture
Last 30m: VisuAlgo Online Quiz 2 (12%)

Good Friday on Fri, 15 Apr
Easter Sunday on Sun, 17 Apr
CS2040C last classes are not affected
T11+L11: tut11.pdf
Dijkstra's Review (both versions),
PS6 Discussion (algorithmic)
Final paper preparation (from any past paper),
Class Photo (for momento)

Tutorial Participation Marks given (3%)
Due: Thu, 14 Apr 22, 07.59am
(after the last lab + 1 more night)
Study Week, 16-22 Apr 2022
Make-up (or Remedial) Practical Exam
Timing: Wed, 20 Apr 2022 (10.00am-12.00noon, 120m)
PS1: Have to score ≥ ??? and email Steven to OPT-IN to take remedial.
PS2: The version from last S1 AY 2021/22 (the level will be like this)
Details in the email sent to 25 attendees

Final Assessment Consultations (per request)
Collection of Past Paper Last Questions

Final Assessment Past Papers:
AY 2017/18: S1-final.pdf, S2-final.pdf, S4-final.pdf,
AY 2018/19: S1-final.pdf (Prof Gary), S2-final.pdf,
AY 2019/20: S1-final.pdf, S2-final.pdf (Dr Alan, N/A),
AY 2020/21: S1-final.pdf, S2-final.pdf (Dr Alan+myself),
AY 2021/22: S1-final.pdf (most recent past paper), S2-final.pdf (our paper, obviously N/A yet).

NUS Online Teaching Feedback System closes on Friday of Study Week
Final Assessment (40%)
Date and Time: Tue, 26 Apr 2022, 1-3pm
Venue: e-Exam (LumiNUS Quiz); We use the same SoC e-Exam SOP
Same format as with our Midterm Quiz (but all topics and in 2 hours)
There will be MCQs/MRQs/fill-in-the-blanks with automatic grading to reduce our grading load.
The rest will be a few (long) essay questions.

Partial Class Roster

Steven uses a small-scale gamification system in his version of CS2040/C/S for extra study motivation.
The list of possible achievements are as follows: (achievements highlighted with red color/green color are already completed in the past/being given, respectively).
As the class size is medium (69), only students with at least one achievement will be listed below (so the list is not the full class roster).

  1. I Say Hi (#): Given to first 7 students who reply Steven's welcome email -- (sent on Tue, 28 Dec 2021 night) with a long enough reply or write a (long enough) message at class Discord; Any early feedback will always help Steven+Dr Alan in refining the preparation of the next iteration of this module
  2. Kiasu lv 1 (#): Given to the first 7 students who solve all 10 :O (yeah...) problems of PS0 — Easy C++/coding challenges, albeit that one is 'totally optional' and 'not graded'
  3. Kiasu lv 2 (#): Given to the first 7 students who solve all problems of PS1, the first graded PS
  4. My Life is in Order (#): Given to the first 7 students who solve all subtasks of PS2
  5. List Master (#): Given to the first 7 students who solve all subtasks of PS3
  6. Chow-Yuan-Bin Award lv 1 (#): Given to the top 7 students who scored the highest in the first half VA OQ (likely 20/20) and if ties, by fastest submission time as acknowledged by VisuAlgo Online Quiz system
  7. Potential TA: Given to everyone (actually only 7) who score ≥ ??.0 points in the Midterm Quiz: You survived all those intellectual challenges...
  8. Scheduling Master (#): Given to the first 7 students who solve all subtasks of PS4
  9. Mapping Master (#): Given to the first 7 students who solve all subtasks of PS5
  10. Graph Master (#): Given to the first 7 students who solve all subtasks of PS6
  11. Competitive Programmer to be (#): Given to everyone who score > ??? points in Practical Exam (CS2040/C/S first 2/3) under that very stressful environment
  12. Chow-Yuan-Bin Award lv 2 (#): Given to the top 7 students who scored the highest in the second half VA OQ (likely 20/20) and if ties, by fastest submission time as acknowledged by VisuAlgo Online Quiz system
  13. Nowhere to Hide (Reason): Given to students who already remembered by Steven (closed by last lecture)
  14. Kattis Mini Apprentice (Kattis profile link): Given to students who manage to get 300.0 or more Kattis points at open.kattis during the execution of CS2040/C/S in S1 AY 2021/22 (closed by last lecture) (submitting all my AC/near-AC demo code will only give you about ~100.0 free Kattis points... so you must have done a lot more extra homework than necessary; PS: This is my account and this CS2040/C/S-specific page of Methods to Solve can help you get this achievement)
No Student Name Achievements