1 / 12

Section: Problem Set 3

CS50. Section: Problem Set 3. Jordan Jozwiak. Announcements. Don’t forget about Walkthrough, CS50 Shorts, cs50.net/discuss, office hours when attempting psets Pset0 and Pset1 feedback and grades are out

aya
Download Presentation

Section: Problem Set 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS50 Section: Problem Set 3 Jordan Jozwiak

  2. Announcements • Don’t forget about Walkthrough, CS50 Shorts, cs50.net/discuss, office hours when attempting psets • Pset0 and Pset1 feedback and grades are out • Access section materials from this year and last year at http://cloud.cs50.net/~jjozwiak/ • Pset2 feedback and grades will returned by Thursday at the latest

  3. Introductions (again) • “Important stuff” • Name • Year • House • Concentration • Actually important stuff (pick two) • Favorite TV show • Favorite band • Favorite flavor of ice cream • Best and/or worst rumor you’ve heard about CS50

  4. This Week • Note on grading • Pset2 feedback • Sample Pset2 Solutions • Section of Questions • Using GDB • Runtime • Searching • Sorting • Different algorithms

  5. A Note on Grading • Normalized between TFs • Professor Malan stresses that the focus should be on improvement! • Grades should be considered as • 1 Poor • 2 Fair • 3 Average • 4 Good • 5 Excellent • Discussion at end of semester to look at holistic grade

  6. Pset2 – Feedback • Don’t use trailing comments; // they are annoying • Return values for main • Return 0 at end of main (Stylistically correct, just know that it is implicit) • Use different return values for different errors (Return 1, Return 2, etc.) • Program header at top of files (file name, your name, brief description of functionality) • Variable names should be descriptive, but not lengthy • Include white space before comments

  7. Pset2 – Feedback continued… • ASCII values • ‘a’, ‘z’, ‘A’, ‘Z’ are like useful variable names • 97, 65, etc. seem like arbitrary numbers (if there weren’t the above notation then you would want to use magic numbers!) • #define constants • #define ALPHABET_LENGTH 26 • Much more useful than seeing the number 26 in the middle of code • If statements that return from main don’t need else statements after them

  8. Pset2 – Feedback continued… • Always think about the possible cases and how we can be exhaustive without performing unnecessary checks • argc != 2 • Possible characters • Uppercase • Lowercase • Everything else

  9. Sample Pset2 Solutions • What’s good? • Could anything be better? • Other questions?

  10. Section of Questions • Shorts… GDB, Bubble Sort, etc. • What does GDB let you do? • Why does binary search require that an array be sorted? • Why is bubble sort in ? • Why is insertion sort • What’s the worst-case running time of merge sort? • How does selection sort work?

  11. Coding time!!! • Use CS50 Spaces • http://apps.cs50.net/spaces • Work with partners (but actually)! • Our section’s website (for extra resources, maybe) • http://cloud.cs50.net/~jjozwiak/

  12. On your way out… • Check out cheat sheets online! • Feedback • How comfortable are you with the material? • How is the pace of section? • Any other questions, suggestions or concerns?

More Related