David J. Malan, Instructor
malan@post.harvard.edu
http://www.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, encapsulation, data structures, databases, memory management, software development, virtualization, and websites. Languages include C, PHP, and JavaScript plus SQL, CSS, and XHTML. 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. (Week 2 onward were filmed in HDV by Chris Thayer.) Notes were taken by Andrew Sellergren '08.

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 ▶ Wednesday ▶ Friday ▾ expand all
Week 1 ▶ Wednesday ▶ Friday ▾ expand all

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

Week 2 ▶ Monday ▶ Wednesday ▾ expand all
Week 3 ▶ Monday ▶ Wednesday ▾ expand all

Linear search. Binary search. Asymptotic notation. Recursion. Pseudorandomness. Bubble sort. Selection sort. Insertion sort. Merge sort. Debugging.

Week 4 ▶ Monday ▶ Wednesday ▾ expand all

Structures. Dynamic memory allocation. Stack and heap. Pointers. Debugging, continued.

Week 5 ▶ Monday ▶ Wednesday ▾ expand all
Week 6

No lectures this week.

    Week 7 ▶ Monday ▶ Wednesday ▾ expand all

    Valgrind. Bitwise operators. Hash tables. Trees. Binary search trees. Tries. Huffman coding.

    Week 8 ▶ Monday ▶ Wednesday ▾ expand all
    Week 9 ▶ Monday ▶ Wednesday ▾ expand all
    Week 10 ▶ play ▾ expand all
    Week 11 ▶ play ▾ expand all
    Week 12 ▶ play ▾ expand all

    Sections (otherwise known as "recitations" or "precepts" at other universities) supplement lectures. Led by Matthew Chartier '12, these sections were filmed in Harvard Hall.

    Because Computer Science 50 is offered through Harvard Extension School as "Computer Science E-52", you may sometimes hear Matt refer to the latter. The courses are one and the same.

    Week 1 ▶ play
    Week 2 ▶ play
    Week 3 ▶ play
    Week 4 ▶ play
    Week 5
    Week 6 ▶ play
    Week 7 ▶ play
    Week 8 ▶ play
    Week 9 ▶ play
    Week 10 ▶ play

    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 Marta Bralic '11, these walkthroughs were filmed in Emerson Hall.

    If you have questions or would like to discuss the material with others, you may want to join the Google Group at right. And if you'd like to implement these problem sets, you'll likely want to download the CS50 Appliance.

    Problem Set 0: Scratch

    Create your own animation, game, or interactive art.

    Problem Set 1: C ▶ play ▾ expand all

    Meet Linux and C.

    Problem Set 2: Crypto ▶ play ▾ expand all

    Encrypt and decrypt sensitive information.

    Problem Set 3: The Game of Fifteen ▶ play ▾ expand all

    Implement a party favor.

    Problem Set 4: Sudoku ▶ play ▾ expand all

    数字は独身に限る。

    Problem Set 5: Forensics ▶ play ▾ expand all

    Recover lost photos. Solve a murder mystery.

    Problem Set 6: Mispellings ▶ play ▾ expand all

    Implement a spell-checker that’s faster than your classmates'.

    Problem Set 7: C$50 Finance ▶ play ▾ expand all

    Design a database. Build a dynamic website.

    Problem Set 8: Mashup ▶ play ▾ expand all

    Google Maps meet Google News. And Ajax.

    Below are quizzes; other answers may be possible. Reviews were led by Rose Cao '11, Matthew Chartier '12, Jesse Cohen '10, Derek Lietz '09, and Mike Teodorescu '11.

    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 ▶ play ▾ expand all

    Covers weeks 0 through 5.

    Quiz 1 ▶ play ▾ 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 and Fall 2008's seminars are also available.

    Android Apps with App Inventor ▶ play

    by Alex Hugon '11 and Filip Zembowicz '11

    App Inventor for Android is a Scratch-like environment that lets you create new mobile applications. With it, you can explore communication, location-awareness, social networking, and massive Web-based data collections. This is a great way to try out mobile apps, and to collaborate with a community of developers at Google and other colleges participating in the App Inventor alpha.

    Android Apps with Java ▶ play

    by Kent Rakip '11

    Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications that run on Android-powered devices.

    Beginning iPhone Development: Resources, Tips & Tricks ▶ play

    by Winston Yan '10 and Jonathan Yip '12

    Interested in developing an app for the iPhone or iPod touch? This seminar aims to not only be a tutorial on beginning iPhone development, but will also 1) introduce a number of resources we've found useful during the development of Rover and 2) provide you with a number of tips, tricks, and customizations that we've learned through trial and error. Hopefully from our experience, we can make your life a lot easier!

    Building Social Applications with the Facebook Platform ▶ play

    by Keito Uchiyama '11

    When you "SuperPoke" someone on Facebook or play "Farmville", you're using applications built on the Facebook Platform, an extensive infrastructure designed to make it easy for developers to leverage the social graph of the world's largest social networking website. Now that the Facebook Platform is available outside facebook.com as Facebook Connect and in many other languages beyond PHP, an increasingly large number of notable websites are using the Platform to add the social element to their websites and other applications. Learn how to create such an application yourself and join the social web.

    Dynamic Websites on Rails ▶ play

    by Greg Brockman

    Hadoop for Large-Scale Computation ▶ play

    by Zak Stone

    Welcome to the era of Big Data, in which petabytes of information are accumulating at an accelerating rate and desperately need you to analyze them. Computation on billions of web pages or photos or log entries requires new tools and a new way of thinking about programming; this seminar will introduce you to Hadoop, the most prominent open-source ecosystem of tools for working with exciting new large-scale datasets.

    Interactive Data Applications ▶ play

    by Mike Tucker '03

    Build an interactive, data-driven application using Endeca's commercial-grade data tools with XQuery, a standards-based programming language tuned to working with XML.

    Endeca provides a platform for search applications that allows users to navigate through data based on record attributes. This means that you can take any dataset that you have in mind and open it up to the world with the type of high quality text search and faceted navigation that you find on the top e-commerce and media sites including HomeDepot.com, NewEgg.com, NewsSift.com and Time.com.

    Endeca provides access to these features and more through APIs that are exposed in a standard query language for XML databases called XQuery, in which you can write arbitrarily complex programs. These programs can then be hosted in your Endeca application as web-services, meaning that they can be invoked from your AJAX or Flex-based User Interface.

    Scraping Data from the Internet ▶ play

    by Keito Uchiyama '11

    Stocks, sports scores, dining menus--there's a plethora of information out there on the Internet that's not available by easily accessible Application Programming Interfaces (APIs). Web scraping, or screen scraping in general, helps extract that data by parsing the HTML on web pages, making data from any website on the Internet accessible to your application and prime for mashing up in whatever creative way you can imagine. We'll go over an example, CrimsonDining.org, which uses robust scraping to retrieve menu data from Dining Services. The techniques covered in this seminar will apply to any programming language or framework.

    Visualizing Data and Data Art with Processing ▶ play

    by Filip Zembowicz '11

    Processing is an open-source programming language based on Java and designed with visualization in mind. It is for students, artists, designers, researchers, and hobbyists for learning, prototyping, and production of graphics, both static and interactive. It is used intensively in the class CS 171: Visualization, taught by Hanspeter Pfister. This tutorial will cover basic processing fundamentals, including loading data, drawing complex shapes from primitives, physics, and handling user interaction. These programs can then be run online or through downloadable executables.

    Visualizing Data Interactively: A Primer on Actionscript, Flex, and the Flare Visualization Library ▶ play

    by Filip Zembowicz '11

    Large datasets are everywhere nowadays: information on populations, biology, voting, prices, and distances are just a few of the various categories of data easily accessible online. However, many of these resources suffer from poor user interface design--it is hard for a user to see the information holistically, to see patterns in data, to observe how the data changes over time, and to remain engaged with static blocks of text and images. Information visualization allows for the facile design of engaging ways to explore data. In this tutorial, I will introduce Actionscript (the language that powers Flash animations) and Flex (an Adobe product that allows rapid development of web-based flash apps), specifically focusing on how the Flare visualization library can be utilized to load, display, and interact with quantitative, qualitative, and relative data. Examples of beautiful visualizations: http://www.visualcomplexity.com/vc/.

    Adobe has recently announced that the forthcoming Flash CS5 will be able to run on iPhone -- this represents a tremendous opportunity for getting into the mobile wave.

    Voice Application Development ▶ play

    by Wellie Chao '98

    Provide information and services to users over the phone using speech synthesis, dual-tone multi-frequency (DTMF) capture, and public switched telephone network (PSTN) connectivity. Build voice telephony applications using scripting languages such as Perl and Python configured with XML. FreeSWITCH is a SIP-compliant softswitch that lets you talk to other softswitches, softphones, IP phones, and (via SIP) the PSTN to reach (or be reached by) any mobile phone or landline around the world. The CS50 Shuttleboy Voice application (617-BUG-CS50 / 617-284-2750) is built on FreeSWITCH. Organizations such as Delta Airlines, Capital One, Citibank, and even Harvard use interactive voice response (IVR) systems to provide information to customers such as flight times, bank balances, and dinner menus, and to allow customers to perform transactions such as booking tickets, transferring money, making payments. With FreeSWITCH and your favorite programming language (C/Java/Perl/Python/PHP/Javascript/Ruby/etc.), building such systems is a snap. In addition, FreeSWITCH has some cool features such as receiving faxes, sending dynamically generated faxes, integration with Google Talk, mixing of audio streams from multiple sources such as other phone lines for conferencing or local files/shoutcast.

    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.