Lab 03: Timing Tests and Randomized Comparison Tests
Timing Tests for List61B #
Timing the construction of an AList with a bad resize strategy
public void addLast(Item x) {
if (size == items.length) {
resize(size + 1);
}
items[size] = x;
size = size + 1;
}Solution:
Timing the construction of an AList with a good resize strategy
Solution:
Timing the getLast method of SLList #
Solution:
Randomized Comparison Tests
Simple Comparison Test #
Solution:
Randomized Function Calls #
Solution:
Fixing the bug
Original:
Solution:
Reasoning:
Last updated