Lecture Notes – April 21, 2005
v merely copying the address so that both variable names referenced the same array
v copying the address backwards after the loop generating the values, so that the generated values disappeared DriverSortV2
v
copying the address backwards inside the loop
generating the values which caused only the first generated value to
disappear DriverSortV1
v copying the address backwards before the loop generating the values which caused both references to refer to the same array and the generated values to all be there DriverSortV3copying the address before the loop and then modifying one value in each array after the loop generating the values and seeing that the references were the same and the changes show up regardless of which reference is used to print the arrays DriverSortV4
v making an item by item variant of each value generated so that the references pointed to two different arrays and we could see that they were different. DriverSortV6
v copying the address correctly inside the loop so that the first element will also be correct but it copies the address multiple times when it only has to do it once. DriverSortV5
Abstract
data types |
Data structures that can be used to implement ADT |
v A list |
An array, an ArrayList, a LinkedList |
v A stack |
An array, an ArrayList, a LinkedList |
v A queue |
An array, an ArrayList, a LinkedList |
v enqueue
v dequeue
v isEmpty
v possibly isFull