CS50 Problem Sets
整合了 CS50 2023 Spring 的 Problem Sets 1-8 及 Week1 练习题
GitHub Repository: https://github.com/Ricky2333/CS50-PSet
CS50 Study Group:677535709(QQ Group)
Problem Set 1 (C)
CS50 Problem Set1 Page:https://cs50.harvard.edu/x/2023/psets/1/
What to Do 🚀
Be sure you have completed Lab 1 before beginning this problem set.
- Log into code.cs50.io using your GitHub account.
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Hello
- Submit one of:
- this version of Mario if feeling less comfortable
- this version of Mario if feeling more comfortable
- Submit one of:
If you submit both versions of Mario, we’ll record the higher of your two scores. If you submit both Cash and Credit, we’ll record the higher of your two scores.
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Hello | https://cs50.harvard.edu/x/2023/psets/1/hello/ |
| P2 - Mario-less | https://cs50.harvard.edu/x/2023/psets/1/mario/less/ |
| P3 - Mario-more | https://cs50.harvard.edu/x/2023/psets/1/mario/more/ |
| P4 - Cash | https://cs50.harvard.edu/x/2023/psets/1/cash/ |
| P5 - Credit | https://cs50.harvard.edu/x/2023/psets/1/credit/ |
Problem Set 2 (C)
CS50 Problem Set2 Page:https://cs50.harvard.edu/x/2023/psets/2/
What to Do 🚀
Be sure you have completed Lab 2 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Readability
- Submit one of:
- Bulbs, if feeling less comfortable
- Caesar, if feeling less comfortable
- Substitution, if feeling more comfortable
- Wordle50, if feeling more comfortable
If you submit more than one of Bulbs, Caesar, Substitution, or Wordle50, we’ll record the single highest of your scores among those problems.
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Readability | https://cs50.harvard.edu/x/2023/psets/2/readability/ |
| P2 - Bulbs | https://cs50.harvard.edu/x/2023/psets/2/bulbs/ |
| P3 - Caesar | https://cs50.harvard.edu/x/2023/psets/2/caesar/ |
| P4 - Substitution | https://cs50.harvard.edu/x/2023/psets/2/substitution/ |
| P5 - Wordle50 | https://cs50.harvard.edu/x/2023/psets/2/wordle50/ |
Problem Set 3 (C)
CS50 Problem Set3 Page:https://cs50.harvard.edu/x/2023/psets/3/
What to Do 🚀
Be sure you have completed Lab 3 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Plurality
- Submit one of:
If you submit both Runoff and Tideman, we’ll record the higher of your two scores.
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Plurality | https://cs50.harvard.edu/x/2023/psets/3/plurality/ |
| P2 - Runoff | https://cs50.harvard.edu/x/2023/psets/3/runoff/ |
| P3 - Tideman | https://cs50.harvard.edu/x/2023/psets/3/tideman/ |
Problem Set 4 (C)
CS50 Problem Set4 Page:https://cs50.harvard.edu/x/2023/psets/4/
What to Do 🚀
Be sure you have completed Lab 4 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit one of:
- this version of Filter if feeling less comfortable
- this version of Filter if feeling more comfortable
- Submit one of:
If you submit both versions of Filter, we’ll record the higher of your two scores.
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Filter-Less | https://cs50.harvard.edu/x/2023/psets/4/filter/less/ |
| P2 - Filter-More | https://cs50.harvard.edu/x/2023/psets/4/filter/more/ |
| P3 - Recover | https://cs50.harvard.edu/x/2023/psets/4/recover/ |
| P4 - Reverse | https://cs50.harvard.edu/x/2023/psets/4/reverse/ |
Problem Set 5 (C) - Speller
CS50 Problem Set5 Page:https://cs50.harvard.edu/x/2023/psets/5/
What to Do 🚀
Be sure you have completed Lab 5 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Speller
Problem Set 📚
实现一个拼写检查程序,使用哈希表。
$ ./speller texts/lalaland.txt
MISSPELLED WORDS
[...]
WORDS MISSPELLED:
WORDS IN DICTIONARY:
WORDS IN TEXT:
TIME IN load:
TIME IN check:
TIME IN size:
TIME IN unload:
TIME IN TOTAL:
Specification
实现 load, hash, size, check, unload 函数,使用哈希表实现高效的拼写检查。
- 你不能修改
speller.c或Makefile - 你必须修改
dictionary.c来实现这些函数 - 你的哈希函数必须是自己编写的,不能使用在线找到的
- 你的实现必须是大小写不敏感的
- 不能有内存泄漏
Hints
- 使用
strcasecmp进行大小写不敏感的比较 - 使用
valgrind检查内存泄漏
valgrind ./speller texts/cat.txt
Problem Set 6 (Python)
CS50 Problem Set6 Page:https://cs50.harvard.edu/x/2023/psets/6/
What to Do 🚀
Be sure you have completed Lab 6 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date. - Submit Hello in Python
- Submit one of:
- this version of Mario in Python, if feeling less comfortable
- this version of Mario in Python, if feeling more comfortable
- Submit one of:
- Submit Readability in Python
- Submit DNA in Python
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Hello | https://cs50.harvard.edu/x/2023/psets/6/hello/ |
| P2 - Mario-Less | https://cs50.harvard.edu/x/2023/psets/6/mario/less/ |
| P3 - Mario-More | https://cs50.harvard.edu/x/2023/psets/6/mario/more/ |
| P4 - Cash | https://cs50.harvard.edu/x/2023/psets/6/cash/ |
| P5 - Credit | https://cs50.harvard.edu/x/2023/psets/6/credit/ |
| P6 - Readability | https://cs50.harvard.edu/x/2023/psets/6/readability/ |
| P7 - DNA | https://cs50.harvard.edu/x/2023/psets/6/dna/ |
Problem Set 7 (SQL)
CS50 Problem Set7 Page:https://cs50.harvard.edu/x/2023/psets/7/
What to Do 🚀
Be sure you have completed Lab 7 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Movies
- Submit Fiftyville
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - Movies | https://cs50.harvard.edu/x/2023/psets/7/movies/ |
| P2 - Fiftyville | https://cs50.harvard.edu/x/2023/psets/7/fiftyville/ |
Problem Set 8 (Web)
CS50 Problem Set8 Page:https://cs50.harvard.edu/x/2023/psets/8/
What to Do 🚀
Be sure you have completed Lab 8 before beginning this problem set.
- Log into code.cs50.io using your GitHub account
- Run
update50in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now - Submit Homepage
Problem Set 📚
| 题目 | 链接 |
|---|---|
| P1 - HomePage | https://cs50.harvard.edu/x/2023/psets/8/homepage/ |
Solution 🧑🏻💻
Ricky’s GitHub Repository for CS50 Problem Sets: https://github.com/Ricky2333/CS50-PSet
CS50 Study Group:677535709(QQ Group)