Assignment 1, due Aug 29

Part of the homework for CS:2630, Fall 2019
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper in discussion section on Thursday. Some parts of assignments may be submitted on-line and completed in discussion section. Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!

  1. A test of your understanding of the prerequisites: Consider this recursive integer function. All operators here are integer operations. This is an informal expression of the function, that is, pseudocode; it is not coded in a real programming language:
    function f( i, j )
       if i = 0
          return 0
       else
          return f( j, i-1 ) + j
    

    a) What is the value of f(1,1)? (0.2 point)
    b) What is the value of f(2,3)? (0.2 point)
    c) What is the value of f(4,5)? (0.2 point)
    d) What is the value of f(6,7)? (0.2 point)
    e) Give a short (20 words suffice) intuitive description of what this function does, not how it does it. (Hint: Ignore the code, look at your answers to parts a to e.) (0.2 point)

  2. A test of your understanding of the prerequisites: Here is another pseudocode fragment:
    operation o(x) -- x may not be null
        if (x.next ≠ null) x.next.back = x.back
        if (x.back ≠ null) x.back.next = x.next
    

    A Question: This code performs an elementary operation on a common data structure. Name that operaton and name the data structure. (A 5 to 10 word answer will suffice.) (0.5 points)

  3. A problem based on Chapter 2: Give the 7-bit ASCII representation of the text "Aug. 29, 19" Don't include the quotation marks. Give your result as a column of binary numbers, one per character. (0.5 points)

  4. Background: Take the due date, 08/19/19, take out the slashes and interpret it as the decimal number 81919.

    a) Convert this to binary using the pen and paper method shown in Chapter 2. Show your work! (0.3 points)

    b) Convert your answer from part A to hexadecimal. (0.3 points)

    You can check your work in the above conversion problems by using any binary-hex-decimal conversion calculator (there are lots of them on the web), but you will be expected to be able to do such conversions by hand.

  5. Background: Follow the instructions in the Getting Started handout for running the 2630 install script. Help will be provided in discussion section for those who have not succeeded in this by then. Write down what the script outputs for you. (0.4 points)