Skip to content

Repository with personal solutions for the problems sets of CS50x 2024

License

Notifications You must be signed in to change notification settings

PLeonLopes/Cs50x-2024

Repository files navigation

CS50x - 2024: Introduction to Computer Science

This repository contains all the code and projects developed during the CS50x - 2024 course offered by Harvard University. CS50x is one of the most renowned computer science courses, providing a comprehensive introduction to the principles of computer science and programming. Over the course of several weeks, it covers foundational topics such as algorithms, data structures, web development, and programming languages like C, Python, and SQL.

Repository Structure

This repository is organized by weeks, following the course structure. Each folder contains lectures exercises, problems sets and projects related to the topics covered that week.

Directories Overview:

  • Week 0 - Scratch: Visual programming with Scratch to introduce problem-solving techniques.
  • Week 1 - C Programming fundamentals in C, including loops, conditions, and basic data manipulation.
  • Week 2 - Arrays: Advanced manipulation of data using arrays, strings and Command-line Arguments.
  • Week 3 - Algorithms: Sorting, searching, and understanding algorithmic efficiency.
  • Week 4 - Memory: Exploring pointers, memory management, and more advanced C programming concepts.
  • Week 5 - Data Structures: Core data structures like linked lists, hash tables, and trees.
  • Week 6 - Python: Programming in Python with real-world applications and advanced concepts.
  • Week 7 - SQL: Database creation, queries, and managing structured data.
  • Week 8 - HTML, CSS, JavaScript: Introduction to Web-based topics to build interactive websites with client-side technologies.
  • Week 9 - Flask: Creating dynamic web applications using the Flask framework.
  • Week 10 - Cybersecurity: Introduction to the fundamentals of cybersecurity, including encryption, secure communication, and vulnerability assessment.

Week-by-Week Overview

Week 0 - Scratch
  • Problem Set 0
Exercise Description
Scratch Project in "Scratch" -> "COOKIE EATER". A bootleg version of cookie clicker
Week 1 - C
  • Problem Set 1
Exercise Description
Hello, It’s Me Prompt the user for their name and then say "hello" to that user.
Mario More Print an adjacent pyramid, using hashes (#) for bricks.
Cash Print the minimum coins needed to make the given amount of change.
  • Lecture Exercises: agree.c; calculator.c; compare.c; hello.c; mario.c; woof.c
Week 2 - Arrays
  • Problem Set 2
Exercise Description
Scrabble Determine the winner of a short Scrabble-like game.
Readability Calculate the approximate grade level needed to comprehend some text.
Caesar Encrypt messages using Caesar’s cipher.
  • Lecture Exercises: buggy.c; greet.c; hi.c; length.c; length2.c; scores.c; status.c; string.c; uppercase.c; uppercase2.c
Week 3 - Algorithms
  • Problem Set 3
Exercise Description
Sort Determine which sorting algorithm is used by each file.
Plurality Run a plurality election.
Runoff Simulate a runoff election.
Tideman Implement ranked-preference voting using adjacency matrix of candidates.
  • Lecture Exercises: iteration.c; phonebook.c; recursion.c; searchNUM.c; searchSTR.c
Week 4 - Memory
  • Problem Set 4
Exercise Description
Filter-less Implement the functions that can apply grayscale, sepia, reflection, or blur filters to the images.
filter-more Implement the functions that can apply grayscale, reflection, blur, or edges filters to the images.
recover Implement a program that recovers JPEGs from a forensic image.
volume Change the volume of a sound file by a given factor.
  • Lecture Exercises: addresses.c; backup.jpg; cat.jpg; compare.c; copy.c; cp.c; garbage.c; get.c; memory.c; phonebook.c; phonebook.csv; swap.c
Week 5 - Data Structures
  • Problem Set 5
Exercise Description
Inheritance Simulate genetic inheritance of blood type.
Speller Implement a program that spell-checks a file using a hash table.
  • Lecture Exercises: hashtable.c; linkedlist.c; linkedlist2.c; list.c; tree.c; tries.c
Week 6 - Python
  • Problem Set 6
Exercise Description
Dna Take a sequence of DNA and determine which person it most likely belongs to.
Sentimental-cash Print the minimum coins needed to make the given amount of change.
Sentimental-hello Prompt the user for their name and then say "hello" to that user.
Sentimental-mario-less Print a right-aligned pyramid, using hashes (#) for bricks.
Sentimental-mario-more Print an adjacent pyramid, using hashes (#) for bricks.
Sentimental-readability Calculate the approximate grade level needed to comprehend some text.
  • Lecture Exercises: agree.py; calculator.c; calculator.py; compare.py; dictionary.py; exit.py; greet.py; hello.c; mario.py; mario1.c; meow.py; moo.py; phonebook.py; phonebook2.py; qr.png;qr.py; score.py; uppercase.py
Week 7 - SQL
  • Problem Set 7
Exercise Description
Fiftyville Solve the mystery of the stolen duck with the town's database. (Best pset. Incredible!)
Movies Write SQL queries to answer questions about IMDB's database of movies.
Songs Write SQL queries to answer questions about a database of the 100 most-streamed songs on Spotify (2018 data).
  • Lecture Exercises: favorites.csv; favorites.db; favorites.py; favorites2.py; favorites3.py; favorites4.py; favorites5.py; shows.db
Week 8 - HTML, CSS, JavaScript
  • Problem Set 8
Exercise Description
Homepage Build a simple homepage using HTML, CSS, and JavaScript.
Trivia Write a webpage that lets users answer trivia questions.
  • Lecture Exercises: autocomplete.html; background.html; blink.html; bridge.png; cat.gif; geolocation.html; heading.html; hello.html; hello2.html; hello3.html; home.css; home.html; image.html; link.html; list.html; meta0.html; meta1.html; paragraphs.html; phonebook0.html; phonebook1.html; register.html; search.html; search2.html; table.html; video.html; video.mp4
Week 9 - Flask
  • Problem Set 9
Exercise Description
Birthdays Create a web application to keep track of friends’ birthdays.
Finance Implement a website via which users can simulate buying and selling stocks, using a external API.
  • Lecture Exercises: froshmins; froshmins2; hello; login; shows; store
Week 10 - Cybersecurity
  • No problem sets were provided.

  • Lecture Exercises: crack.py; crack2.py; crack3.py


Final Project: Bank Loan Analyzer

The Bank Loan Analyzer is a Flask-based web application that predicts loan approval using a Random Forest Classifier Machine Learning Model. It allows users to input data, receive predictions, and track their history, showcasing the integration of machine learning in web development. Check the FinalProject README.MD for more information!


Important

ACADEMIC HONESTY

Academic honesty is a cornerstone of learning. If you are taking the CS50x course, avoid copying these solutions. Strive to solve the problem sets on your own to fully benefit from the learning experience.

This was CS50!