David J. Malan, Instructor
malan@harvard.edu
http://cs.harvard.edu/malan

Harvard College

Introduction to the intellectual enterprises of computer science and the art of programming. This course teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, algorithms, encapsulation, data structures, databases, memory management, security, software development, virtualization, and websites. Languages include C, PHP, and JavaScript plus SQL, CSS, and HTML. Problem sets inspired by real-world domains of biology, cryptography, finance, forensics, and gaming. Designed for concentrators and non-concentrators alike, with or without prior programming experience.

Loading...

These lectures were filmed in Sanders Theatre in Memorial Hall by Chris Thayer. Notes were taken by Andrew Sellergren '08. Music from lectures is available via iTunes on the CS50 Soundtrack 2011.

If you have questions or would like to discuss the material with others, you may want to join the Google Group at right.

Week 0 ▾ expand all
Week 1 ▾ expand all

C. Source code. Compilers. Object code. GCC. Functions. Comments. Standard output. Arithmetic operators. Precedence. Local variables. Types. Casting. Standard input. Libraries. Boolean expressions, continued. Conditions, continued. Loops, continued.

Week 2 ▾ expand all

Functions, continued. Global variables. Parameters. Return values. Stack. Frames. Scope. Arrays. Strings. Command-line arguments. Cryptography.

Week 3 ▾ expand all

Linear search. Binary search. Asymptotic notation. Recursion. Bubble sort. Selection sort. Debugging.

Week 4 ▾ expand all
Week 5 ▾ expand all
Week 7 ▾ expand all

File I/O. Linked lists. Stacks. Queues. Valgrind. Hash tables. Trees. Binary search trees. Tries.

Week 8 ▾ expand all
Week 9 ▾ expand all
Week 10 ▾ expand all
Week 11 ▾ expand all
Week 12 ▾ expand all

Sections (otherwise known as "recitations" or "precepts" at other universities) supplement lectures. Led by Jason Hirshhorn '14, these sections were filmed in Sever Hall.

Week 1 ▾ expand all

CS50 Appliance. make and gcc. Variables. printf. Conditions. Loops. Commenting.

Week 2 ▾ expand all

Functions. main. Arrays. Strings. Caesar cipher. Vigenère cipher. Magic numbers.

Week 3 ▾ expand all

gdb. Arrays. Linear search. Binary search. Running time, asymptotic notation. Bubble sort. Selection sort.

Week 4 ▾ expand all

Merge sort. Pointers. Stack versus heap. malloc, free.

Week 5

Pointers. Stack, heap. Quiz 0 Q&A.

Week 6 ▾ expand all

Hexadecimal. Enumerated types. Structs. File I/O.

Week 7 ▾ expand all

Valgrind. Stacks. Queues. Linked lists. Hash tables. Binary search trees. Tries.

Week 8 ▾ expand all

HTML. chmod. CSS. MySQL.

Week 9 ▾ expand all

JavaScript.

Week 10 ▾ expand all

Review for Quiz 1.

In order to accommodate students with different backgrounds, some problem sets are released in two editions: a standard edition intended for most students and a "Hacker Edition" intended for some students. Both editions essentially cover the same material. But the Hacker Edition typically presents that material from a more technical angle and poses more sophisticated questions. Most standard editions, though, are accompanied by code "walkthroughs" during which students receive direction on where to begin and how to approach the problem set. Led by Tommy MacWilliam '13, these walkthroughs were filmed in Northwest Science.

If you have questions or would like to discuss the material with others, you may want to join the Google Group at right.

Most of these problem sets require the CS50 Appliance, a virtual machine (for Linux, Mac OS, and Windows) that anyone can download for free.

Problem Set 0: Scratch ▾ expand all
Problem Set 1: C ▾ expand all
Problem Set 2: Crypto ▾ expand all
Problem Set 3: The Game of Fifteen ▾ expand all
Problem Set 4: Sudoku ▾ expand all
Problem Set 5: Forensics ▾ expand all
Problem Set 6: Mispellings ▾ expand all
Problem Set 7: C$50 Finance ▾ expand all
Problem Set 8: CS50 Shuttle ▾ expand all

Below are quizzes; other answers may be possible. Reviews were led by Tommy MacWilliam '13, Joseph Ong '13, and Lexis Ross '13.

If you have questions or would like to discuss the material with others, you may want to join the Google Group at right.

Quiz 0 ▾ expand all

Covers weeks 0 through 5.

Quiz 1 ▾ expand all

Covers weeks 0 through 10 with emphasis on 7 onward.

Seminars cover material beyond the scope of the course. Fall 2007's seminars, Fall 2008's seminars, Fall 2009's seminars, and Fall 2010's seminars are also available.

Accelerating Science with the Open Science Grid

by Ian Stokes-Rees

In the mid-1990s, the high-energy physics community (think FermiLab and CERN) started planning for the Large Hadron Collider. Managing the petabytes of data that would be generated by the facility and sharing it with the globally distributed community of over 10,000 researchers would be a major infrastructure and technology problem. This same community that brought us the web has now developed standards, software, and infrastructure for grid computing. In this seminar I'll present some of the exciting science that is being done on the Open Science Grid, the US national cyberinfrastructure linking 60 institutions (Harvard included) into a massive distributed computing and data processing system.

Acing Your Technical Interviews

by Tony Ho '14

Most coding interviews are like another coding competition. I would like to start by talking about resources like Project Euler, Poj, USACO, Codeforces, Topcoder. Then I will move into the broad topics that everyone needs to know to answer simple questions. Finally, I will end with a hands-on period where we will try some problems and go over some problems that I have personally seen and find very interesting.

Android Application Development

by Jordan Jozwiak '14

Learn the basics of the Android Application Interface and developing Java applications using Eclipse.

appLab.Phone(Mango) Session One

by Edwin Guarin of Microsoft

You will learn how to get started on that next great app for the Windows Phone. Session One will attempt to cover: Introduction to Windows Phone 7.5 for Developers; Building Windows Phone 7.5 Apps with Visual Studio and Silverlight; Getting Started with Sample Code and other resource; Publishing and Monetizing your App in the Marketplace at no cost. For this seminar, install the Windows Phone 7.5 SDK from http://create.msdn.com/en-us/home/getting_started. And create a free Dreamspark and AppHub account using the instructions from http://bit.ly/r2dqFr. This will give you the ability to publish your phone apps and monetize for free.

Beyond Google Maps: Spatial is Special

by Kirk Goldsberry

There's an ongoing geospatial revolution happening right now. Unfortunately, despite the rapid rise of geospatial technologies, here at Harvard there are few if any courses that focus on Geographic Information Science. I propose to lead a brief seminar that introduces the basics of GIScience and hopes to inspire students to generate exciting new spatially aware mobile applications that pick up where popular location-based services such as Google Maps and Yelp leave off. Since a large percentage of "apps" have a spatial component, this topic should be of interest to students looking to design new mobile computing software.

Building Applications in C#

by Mike Teodorescu '11

This seminar is a concentrated introduction to C# and will cover object-oriented programming in C#, collections in C#, exception handling, regular expressions, XML parsing, file I/O, and debugging in Visual Studio. By the end of the course, students should have a solid grasp of this powerful language, which is packed with handy shortcuts and libraries.

CSS for a Beautiful Website

by Charles Bandes

Proper use of CSS allows a tremendous degree of control over both the layout and visual design of a web page. Careful application of style sheets can be the difference between a basic page and a really polished site.

Develop for the BlackBerry... Like a Boss

by Jason Hirschorn '14 and Marta Bralic '12

Learn how to develop applications for BlackBerry smartphone. Imagine integrating the BBM platform into your application or coding the next Brick Breaker. The possibilities are endless!

Educational Software

by Katie Vale

Interested in writing software to support teaching and learning? This session will discuss how to plan and execute an instructional project, including how to do requirements gathering, how to choose development platforms, and how to assess your project. The instructor has over 20 years' experience in designing and producing educational software.

Emacs

by Matthew Chartier '12

Emacs is an alternative to gedit which empowers you to write code more efficiently. Extensible and highly customizable, Emacs allows users to streamline their editing process by modifying the editor itself to suit their needs. Topics covered will include keyboard shortcuts to navigate text files quickly, using buffers to more effectively work with code spanning multiple files, and automating repetitive and tedious editing tasks on the fly.

From Innovation to Production: Making It Work is Just the Beginning

by Dennis Ravenelle

Thomas Edison is credited with saying that invention is 1 percent inspiration and 99 percent perspiration. Getting an innovative solution from the lab (or the garage) into a real production environment can be an arduous process. But until something delivers real value in a real-world environment, it's just a novelty. Here are some things to consider.

Getting a Job in the Tech Industry

by Matthew Chartier '12 and Melissa Niu '13

A seminar to discuss opportunities available to Harvard students in the tech industry and details about the interview process. The seminar will consist of a presentation and Q&A session with a panel of students with prior experience interviewing for and working in positions in the tech industry.

Getting Started with Node.js

by Beardsley Ruml

An introduction to Node.js, a server-side JavaScript environment with non-blocking IO, and its most popular modules, such as Express (built on Connect) and Socket-IO. The opportunities for real-time browser-based interactions will be demonstrated with a new open-source implementation of backchan.nl. (See http://www.github.com/bruml2/backchannel/)

Git Magic: Versioning Files Like a Boss

by Tommy MacWilliam '13

Tired of sudoku_why_is_it_3_am.c and sudoku_OMG_FINALLY_WORKS.c? Learn how software is developed in the real world with git, a distributed revision control system. Track down bugs faster, manage file histories, and deploy code with efficiency and confidence.

iOS

by Larry Ehrhardt

Quick tour of iOS and how to build a tab-based app with a view, table, and web view.

jQuery: How to Make Your Website Shiny

by Alex Hugon '11

Stolen from jQuery's site: "jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript."

Ruby on Rails

by Lexi Ross '13

Ruby on Rails is an exciting new web development framework that lets you build awesome, dynamic websites in a short amount of time. Ever used Twitter or Groupon? Then you've used a Rails application. The Rails framework utilizes the Ruby programming language, so we'll be learning basic Ruby syntax as well as the tools you need to get started building a Rails app. Bonus: Ruby is insanely fun to code in!

Search and Browse Superpowers: an Introduction to Solr

by Ben Gaucherin

Search and browse capabilities are core to most applications these days. This seminar will review basic concepts behind search, including the more recent development known as faceted search. We will then use Solr, one of the most popular open-source faceted search engines, to see how one can incorporate advanced search and browse capabilities into an application.

User Experience (UX) Design

by Julia Mitelman '13

Ever stumbled upon a product that frustrated you because you couldn't figure out how to use it? Learn how to create products that are intuitive and convenient—no user manual necessary! A sneak peek of CS179, this seminar teaches you what you need to keep in mind when making products so you can create a great best user experience—because it's always the designer's fault!

Web Security

by Carl Jackson '13

You know how to build websites, but do you know how to make them secure? We'll teach you about some of the most common Web Security vulnerabilities and how to fix them.

Below are papers about CS50.

Grading Qualitatively with Tablet PCs in CS 50

Workshop on the Impact of Pen-Based Technology on Education. Blacksburg, Virginia. October 2009.

Moving CS50 into the Cloud

15th Annual Conference of the Northeast Region of the Consortium for Computing Sciences in Colleges. Hartford, Connecticut. April 2010.

Reinventing CS 50

41st Annual ACM Technical Symposium on Computer Science Education. Milwaukee, Wisconsin. March 2010.

Virtualizing Office Hours in CS 50

14th Annual ACM Conference on Innovation and Technology in Computer Science Education. Paris, France. July 2009.