This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-121: Introduction to Data StructuresFall 2009Exercise10/15/2009Bucketing LabDue: Fri, Oct 1611am YOU ARE ENCOURAGED TO WORK ON THIS LAB IN PAIRS. Turn in only one paper with both names on it.Assignment: (worth 5 exercise points) Get the file BucketLab.zip1)Look at the Question1 class. In it, there is an array of numbers that are put into buckets and "re-collected up" a number of times. Look through this file to understand what it is doing. Trace it to see what it does.a) TASK: In the processByDigitmethod, there are two commented lines telling you to draw pictures. // TASK for Question 1: SHOW PICTURE OF BUCKETS HERE// TASK for Question 1: SHOW PICTURE OF ARRAY NOWDraw these pictures on paper. Be sure to draw them in order and label them.b) In the processByDigit method, each bucket was represented as a HashSet. What will happen if we change the program so that each bucket is represented as an ArrayList? Change lines 33 and 35 so that each is an ArrayList and re-do part a by drawing the appropriate pictures.that each is an ArrayList and re-do part a by drawing the appropriate pictures....
View Full Document
- Spring '09
- Data Structures