Visu(al and Virtual)Algo(rithm) Instructor

By Steven Halim


  • Motivation
  • Live Demo
  • SWOT Analysis


On why I build this thing...


I taught the following algorithm classes in NUS SoC:

  1. CS1102(C) in 2005 and also in 2006-2009...
  2. CS201(2/4)0(C) in 2011 until present...
  3. CS3233 in 2009 until present...
  4. CS4234 in 2016 until present...

A Traditional (Algorithm) Lecture

  1. Course Admins
  2. Motivation
  3. Definitions
  4. Pseudocode
  5. A Few Basic Examples
  6. Deeper (Algorithm) Analysis
  7. Some Application Scenarios
  8. (Formative) Pop Quizzes

(At least) no 1-4 and 7 CAN be automated

A Traditional Pre- and Post- (Algorithm) Lecture

Nothing* (usually)...

What If?

I can clone myself...
and make my 'virtual clone' available 24/7
to anyone with Internet access?


Summary of Live Demo 1

  1. VisuAlgo homepage, 23 modules, the range of currently available topics, for *most* SoC CS level 1-4 modules
  2. VisuAlgo BST page, e-Lecture (refresh for random BST), exploration with custom input, changing display language
  3. On who is (the current) number 1 on keyword "algorithm visualization"

Motivation - Tutorials

Frequency # Questions
Many Other Modules
11 weeks
3-5 Qs/week
Reuse past year
My CS2010 class with
VisuAlgo Online Quiz
1-to-1 tutor
#100+ Rand Qs in
Q bank & growing
CS2040/C, CS3233, CS4234
As above As above
With MUCH bigger Q bank :)

Motivation - Assessments

Frequency When
Many Other Modules
2 times
Mid Semester,
End of Semester
CS2010 with
VisuAlgo Online Quiz
At least
4 times
Week 01, 06, 11,
End of Semester
CS2040/C, CS3233, CS4234
(Much) more frequent Maybe a small chunk every week, all automated :)

(Early) Source of Q Bank

I used my collection of past
data structures and algorithms exams @ NUS 2003-2010
and my own CS2010 exams (2011-2016 :O)

Some (but not all) of these questions can be automated

Randomized Questions

Static questions = fixed answers

Issue: Memorizing the answers versus
understanding how to derive the solution

We need to build a system that can
generate questions with randomized parameters

Instant Grading and Feedback

As the questions are randomly generated,
we cannot hardcode the answers

Real algorithms verify the answers (note: there can be ≥1 valid answers) for all questions instantly behind the scene

We give (visual) instant feedback if the answer is wrong

This way, the student can always re-study the visualizations, re-generate new random questions, re-train, and so on until they achieve self mastery of the basic topics

Real (Algorithm) Example

Given a random directed weighted graph (from templates),
compute the shortest path from a random source vertex s
to a random destination vertex t?

Easy: Small Graph; Medium: Medium Graph; Hard: Graph with negative weight edge(s)/cycle(s)

If student X/Y answers correctly/wrongly,
We congratulate X but give feedback to Y by showing the visualization of the appropriate Shortest Path algorithm on the same randomized directed weighted graph G
This check is done by a back-end PHP script that really runs a Bellman Ford's algorithm

Server-Side Technologies

So that students cannot run the algorithms
to generate the answers on their own computers

Live Demo 2

SWOT Analysis


Current Strengths

  1. ~3 000 daily visitors worldwide
  2. from ~(low) hundred different Universities
  3. Top 10 in (Google) search for related keywords
  4. It helps me do better in my algorithm classes :)

Weaknesses of VA (Online Quiz)

It is currently impossible to replicate a creative lecturer's brain with a computerized system

Basically, it cannot generate a new question type
that has not been added by the developer
So, clever and diligent NUS students can ace the Online Quiz

It is NOT for Final (Summative) Assessment level yet...
But good for 'Formative Assessment' level at the moment

Not-so-Good Hard Random Q

Too easy to make careless mistake

Future Works

  1. More User Account features: Personalized?? guidance??
  2. Complete the e-Lecture text and 10 language translations
  3. A few more (hard) algorithm visualization modules
  4. Much more intersting Online Quiz questions


Try VisuAlgo, tell your (CS) colleagues/friends/students