# CMU 15-110 Spring 2019: Principles of Computing Homework 4 (Due Monday 4-Mar at 8pm)

This hw is entirely solo. See the syllabus for details.
1. Group Code Tracing [10 pts, not autograded]
Meet with a TA from your recitation (but outside of recitation) for 30 minutes of small-group CT practice. Your TA's will contact you soon to arrange times for these sessions.

2. alternatingSum(L) [10 pts, autograded]
Write the function alternatingSum(L) that takes a possibly-empty list of numbers and returns the alternating sum (where the sign alternates from positive to negative or vice versa). For example, alternatingSum([5,3,8,4]) returns 6 (that is, 5-3+8-4). Also, if L is empty (no values), return 0. If L is not empty, add the first value into the result, then subtract the second, and so on.

3. median(L) [10 pts, autograded]
Write the non-destructive function median(L) that takes a list of floats (or ints, which you can treat as floats) and returns the median value, which is the value of the middle element (if there are an odd number of values), or the average of the two middle elements (if there are an even number of values). If the list is empty, return None.