Week 4: The Internet & HTML

Unit 3 Quiz

Monday, March 7th, we will have quiz-3, which will be assess your understanding of concepts learned in unit 3. Topics will include:

  • Bubble sort, selection sort, and insertion sort: you must understand how all three work and be able to demonstrate by sorting the first few elements in an array according to each algorithm.
  • Understanding how a function works, how parameters are passed into a function and how it may return a number, a boolean, a string, or nothing at all.
  • Being able to translate one of the sorting algorithms from pseudocode into c code.
  • What does a “seed” do to a random number generator like drand48.

Links to review for Unit 3 Quiz

Slides with sample questions: Unit3 Review Slides

Explanations/Answers to sample questions:
Unit 3 Review Slides Explanations (pdf) / Slides Explanations (MSWord)

Here is an additional video that explains what it means for an algorithm to be in O(n2).

Web Programing

This week we will transition into web programming, getting into an area we are all more familiar with. Interacting in a web browser rather than a command line text prompt.

If you have not yet completed the two required programs from Unit 3, RNG and Sort Race, you can continue to work on these during the beginning of this week. However you should be moving onto HTML by Wednesday or Thursday at the latest.

You can learn more about the two tracks for learning HTML/CSS here.



Week 3

This week we will be working on Problem 3-4 Sort Race. This will be the last program in C you will be required to complete. If you are working on the Hacker Edition of CS50, please keep moving ahead to work on 3-6 Seek. Anybody who has completed Fifteen parts 1 or 2 will receive extra credit.

Problem 3-4: Sort Race

Semester 2, Week 1

If you are coming to the NYC Harvard Hackathon tomorrow here are the details:

Date: Saturday, February 6
Time: 10am to 3pm
Location: Browning School, 52 East 62nd Street (between Park and Madison)

When you arrive please go into the building. I will be there early so I will see you inside. If you signed up with me, you are registered, so they will already be expecting you!

Bring a laptop if possible. But if you can’t no worries, there will be computers available there.


Welcome to the second semester of CS50! We are all moving on to Unit 3 and working on Problems 3-0: RNG, Problem 3-1: Fifteen(Part 1), Problem 3-2: Fifteen(Part 2) and Hacker Edition Problem 3-3: Fifteen(Part 3). Please note that in Unit 3, instead of google forms with aha moments, you will be submitting word or text documents with each program answer the questions in the program spec.

If you are starting on 3-0: RNG, be sure to watch the video on pipes first. Also please note that to “seed” the random number generator, you will do:


and that drand48 will return a float between 0 and 1.

float n = drand48();

If you are finished, or mostly finished with Fifteen before Saturday’s Hackathon, take a look at Problem 3-7: Scramble, so that you have a bit of familiarity with this problem in advance.