Lab5 LinkedLists
Lab5 LinkedLists
//Q1
public LinkedList<String> specialCells(int cellType) {
LinkedList<String> X = new LinkedList<String>();
//add something clever
return X;
}
//Q2
public LinkedList<Integer> copy(LinkedList<String> cellRefs) {
LinkedList<Integer> Y = new LinkedList<Integer>();
//add something clever
return Y;
}
//Q3
public void paste(LinkedList<Integer> values, LinkedList<String>
cellRefs) {
//add something clever
}
}
CS4222 Lab Sheet Week 6
//Q1
public LinkedList<String> specialCells(int cellType) {
LinkedList<String> X = new LinkedList<String>();
//add something clever
return X;
}
//Q2
public LinkedList<Integer> copy(LinkedList<String> cellRefs) {
LinkedList<Integer> Y = new LinkedList<Integer>();
//add something clever
return Y;
}
//Q3
public void paste(LinkedList<Integer> values, LinkedList<String> cellRefs)
{
//add something clever
}
}
1 Add the code for a method with the following header to the TrivialSpreadsheet class
4 Replace ALL references to LinkedList with ArrayList in BOTH the TrivialSpreadSheet and Driver classes
and rerun the Driver. You should get exactly the same outputs. What does that tell us about the
ArrayList and LinkedList collections?