/cs50

My answers to all problem sets from Harvard's cs50 course.

Primary LanguageC

CS50's Introduction to Computer Science

All my solutions to problem sets from Harvard's Introduction to Computer Science. In it's own words: "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, data structures, encapsulation, resource management, security, and software engineering. "

Languages:

  • C
  • Python
  • SQL
  • HTML/CSS/Javascript

Problem Set 0

Langauge: Scratch

  1. Scratch: Implement a project of your choice in Scratch (I built Snake).

Problem Set 1

Langauge: C

  1. Hello: Print "hello, world."
  2. Mario (more comfortable): Print hashtags in the shape of a pyramid from Mario.
  3. Credit: Write an algorithm which validates credit card numbers.

Problem Set 2

Langauge: C

Note that the course was updated from the 2019 to the 2020 version whilst I was tackling pset2 so for this week I have solutions for both syllabi.

2019:

  1. Vigenere: Implement Vigenere's cypher.
  2. Crack: Command line program that cracks passwords hashed by C's <crypt> function.

2020:

  1. Readability: Write a program which determines the approximate reading grade required to understand a text.
  2. Substitution: Implement a substitution cypher.

Problem Set 3

Langauge: C

  1. Plurality: Program that runs a plurality or 'first-past-the-post' election.
  2. Tideman: Program that runs a Tideman election.

Problem Set 4

Langauge: C

  1. Filter (more comfortable): Program that applies filters to BMPs.
  2. Recover: Write a program that can recover a JPEG from a forensic image.

Problem Set 5

Langauge: C

  1. Speller: Implement a program that spell checks files using a hash table.

Problem Set 6

Langauge: Python

Sentimental (same as pset 1/2 but using Python):

  1. Hello
  2. Mario (more comfortable)
  3. Credit
  4. Readability

New:

  1. DNA: Implement a program that identifies a person based on a csv file representing DNA.

Problem Set 7

Langauge: SQL, Python

  1. Movies: Write SQL queries to answer questions about movies using IMDb.
  2. Houses: Implement a program that imports student data into a database and then creates class rosters.

Problem Set 8 (Web Track)

Langauges: HTML, CSS, Javascript, Python (Flask), SQL

  1. Finance: Create a website where users can "lookup", "buy" and "sell" stocks.