加载中...

CS50|Problem Sets


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.

  1. Log into code.cs50.io using your GitHub account.
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit Hello
  4. Submit one of:
  5. Submit one of:
    • Cash if feeling less comfortable
    • Credit if feeling more comfortable

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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit Readability
  4. Submit one of:

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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit Plurality
  4. Submit one of:
    • Runoff, if feeling less comfortable
    • Tideman, if feeling more comfortable

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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit one of:
  4. 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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit Speller

Problem Set 📚

https://cs50.harvard.edu/x/2023/psets/5/speller/

实现一个拼写检查程序,使用哈希表。

$ ./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.cMakefile
  • 你必须修改 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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date.
  3. Submit Hello in Python
  4. Submit one of:
  5. Submit one of:
    • Cash in Python, if feeling less comfortable
    • Credit in Python, if feeling more comfortable
  6. Submit Readability in Python
  7. 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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. Submit Movies
  4. 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.

  1. Log into code.cs50.io using your GitHub account
  2. Run update50 in your codespace’s terminal window to ensure your codespace is up-to-date and, when prompted, click Rebuild now
  3. 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)


文章作者: Rickyの水果摊
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Rickyの水果摊 !
  目录