Course Home | Homework | Programming | Schedule & Lecture Notes | Submit

Saint Louis University

Computer Science A220/P126
Data Structures and Object-Oriented Programming

Michael Goldwasser

Spring 2005

Dept. of Math & Computer Science

Homework Assignment 04

Asymptotics and Singly Linked Lists

Contents:


Overview

Topic: Asymptotics and Singly Linked Lists
Related Reading: Ch. 3 and Ch. 4.4
Due: Monday, 14 February 2005, 1:10pm

Please make sure you adhere to the policies on academic integrity.


Practice Problems


Problems to be Submitted (20 points)

  1. (5 points)

    Reinforcement Exercise R-3.2 of the text.
    Please make sure that you provide the smallest such n0.

    Also, please note that this problem does NOT involve Big-Oh notation, rather it involves the raw growth rates, similar to those given in Table 3.2. The authors explain on page 103 that when they write the expression log n, they mean by default log2 n, the binary logarithm. This is the standard assumption throughout computer science for several reasons, most notably that all numbers are represented internally in binary (as opposed to decimal).

  2. (5 points)

    Reinforcement Exercise R-3.3 of the text.
    See note for previous problem.

  3. (5 points)

    Solve Reinforcement Exercises R-3.20, R-3.21, R-3.22, R-3.23, and R-3.24 of the text. Please strive to give answers in simplest terms, as discussed at the top of page 118.

  4. (5 points)

    Reinforcement Exercise R-4.12 of the text.
    Please give your answer as a C++ method which takes the head of the linked list as a parameter.

    (Note: the ``penultimate'' node is defined as the second-to-last node of the list).


Extra Credit

  1. (2 points)

    Creativity Exercise C-4.16 of the text.
    (Hint available through Hint Server on textbook's website).


Michael Goldwasser
CS A220/P126, Spring 2005
Last modified: Monday, 07 February 2005
Course Home | Homework | Programming | Schedule & Lecture Notes | Submit