Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS 220: Programming with Data Structures - Fall 2009 Homework Assignment, Assignments of Computer Science

A list of programming exercises for the cs 220: programming with data structures course offered in the fall 2009 semester. The exercises cover various topics related to data structures, including arrays, linked lists, and arraylists in java. Students are asked to compare the space requirements of array-based and linked list implementations, consider factors influencing the choice between these representations, and complete several exercises from the textbook.

Typology: Assignments

2009/2010

Uploaded on 02/24/2010

koofers-user-7cm
koofers-user-7cm 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 220 Programming with Data Structures Fall 2009
Homework #2
(not being collected, for exam review)
1. Suppose that you want to store nobjects in a list. Compare the space requirements
to do this using the array based implementation AList (from text) versus the linked
implementation LList. Write an expression for the total amount of space required,
using rto represent the space required by each reference, and dto represent the space
required by each data object.
2. Name three factors that you would consider in deciding between using an array-based
or linked list representation for an application. Explain why each factor is important
for the decision and which implementation method it suggests.
(Note: you must be specific enough about factors so that the factor suggests a par-
ticular implementation, your factors cannot be general like: “consider frequent list
operations.”)
3. Text Chapter 8, Exercise No. 1.
4. Text Chapter 8, Exercise No. 2.
5. Text Chapter 8, Exercise No. 9.
Do this both recognizing that the Java ArrayList class implements the Iterable inter-
face, and pretending that it does not.
6. Text Chapter 8, Exercise No. 16.
7. Text Chapter 9, Exercise No. 3.
8. Text Chapter 9, Exercise No. 6a.
9. Text Chapter 9, Exercise No. 10.
10. Text Chapter 9, Exercise No. 24.

Partial preview of the text

Download CS 220: Programming with Data Structures - Fall 2009 Homework Assignment and more Assignments Computer Science in PDF only on Docsity!

CS 220 – Programming with Data Structures – Fall 2009Homework

(not being collected, for exam review)

  1. Suppose that you want to store to do this using the array based implementation AList (from text) versus the linked n objects in a list. Compare the space requirements implementation LList.using r to represent the space required by each Write an expression for the total amount of space required, reference, and d to represent the space required by each data object.
  2. Nameor linked list representation for an application. three factors that you would consider in deciding between using an array-based Explain why each factor is important for the decision and which implementation method it suggests.(Note: you must be specific enough about factors so that the factor suggests a par- ticular implementation, your factors cannot be general like:operations.”) “consider frequent list
  3. Text Chapter 8, Exercise No. 1.
  4. Text Chapter 8, Exercise No. 2.
  5. Text Chapter 8, Exercise No. 9.Do this both recognizing that the Java ArrayList class implements the Iterable inter- face, and pretending that it does not.
  6. Text Chapter 8, Exercise No. 16.
  7. Text Chapter 9, Exercise No. 3.
  8. Text Chapter 9, Exercise No. 6a.
  9. Text Chapter 9, Exercise No. 10.
  10. Text Chapter 9, Exercise No. 24.