asg3 - COP 3530 Assignment 3 Due Date: Monday, 14th Sep...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3530 Assignment 3 Due Date: Monday, 14th Sep 2009 Have your name and UF ID on what you submit and only soft copies are REQUIRED. 1. Extend the ArrayLinearList to a new class ArrayLinearListExt and include a new method SetSize , which makes the list size equal to the specified size. If the original list size was less than the new one, null elements are added at the end, but if the original size was larger than the new one than, extra elements are removed from the end. Determine the complexity of your method? Test your code. Following is the template for ArrayLinearListExt class: /** Extension of ArrayLinearList as ArrayLinearList Ext*/ package dataStructures; import java.util.*; import utilities.*; public class ArrayLinearListExt extends ArrayLinearList { public ArrayLinearListExt(int capacity) { super(capacity); } //The function SetSize need to be implemented here public void SetSize(int size) { } //The main function to test SetSize method public static void main(String [] args) { // test default constructor ArrayLinearListExt x = new ArrayLinearListExt(10); // test size System.out.println("Initial size is " + x.size()); // test isEmpty if (x.isEmpty()) System.out.println("The list is empty"); else System.out.println("The list is not empty"); // test put x.add(0, new Integer(2));
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

asg3 - COP 3530 Assignment 3 Due Date: Monday, 14th Sep...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online