University of Arizona, Department of Computer Science

CSc 120 (Spring 2025): Assignment 6

Start Date: Mon Mar 3
Due Date: Short problems: 7:00 PM, Thu Mar 6
OCA-6: 11:00 PM, Sat Mar 8
Long problem: 7:00 PM, Tue Mar 18

The short problems are exercises on stacks and recursion. The long problem works with linked lists using the LinkedList and Node classes.

General Requirements

  1. You do not have to comment the short problems.
  2. For the long problems, your code should follow the Style guidelines on the class website. I have updated the guidlines to cover commenting classes.
  3. You may not use concepts not yet covered in class. These concepts include exceptions,with open, type annotations, and importing libraries (unless a library is explicitly mentioned in the specification.)
  4. New restriction: Using try/except to avoid having to check for None when iterating through a linked list is banned.

Short Problems (Due 7pm Thu Mar 6)

(20 points)

Submit your short problems to the folder PA-06-Shorts_Autograder folder on Gradescope here https://www.gradescope.com/

The short problems for this assignment are described in the links below:

  1. Balanced Strings (Stacks)

  2. Decimal to Binary (Stacks)

  3. Sum the Odd Elements (Recursion)

  4. Count the Odd Elements (Recursion)

Long Problem (Due 7pm Tue Mar 18)

(80 points)

  1. fake_news
    File: fake_news.py.

For this problem, submit the file fake_news.py at https://www.gradescope.com .