Tags

, , , , , , ,

Course: Berkeley’s CS 61B: Data Structures.

Homework 3

Homework 3 (mirror) is due before lecture 9.

Goal: get your feet wet with Arrays and singly Linked Lists.

Fill in the smoosh() method in the Homework3 class so that it performs as indicated in the comment. Your solution should not use linked lists, nor should it use your squish() method.

Homework3.java (view | download)

Fill in the squish() method in the SList class so that it performs as indicated in the comment. Your solution should not use arrays, nor should it use your smoosh() method. Do not change the prototype of the SList constructor or the insertEnd method; our test software will call them.
[…]
Fill in the twin() method in the SList class so that it performs as indicated in the comment. Your solution should not use arrays.

Slist.java (view | download)

The rest of the files in hw3 are not modified.

Advertisements