/u2/rebelsky/bin/html2ps
. The command I used
to print this was (approximately) % html2ps -D url | psnup -2 | lp
public static void radixSort() { radixSort(v,0); } // radixSort /** Radix sort the vector, starting with the bth-least significant bit. pre: 0 <= b < # of places in the sequence representation of the data type pre: this vector has been radix sorted for all 0 <= i < p post: this vector is radix sorted */ public static void radixSort(place p) { // Base case, we've run out of bits if (p == PLACES_IN_ELEMENT) return; // Recursive case, partition and move on to the next bit splitAndJoin(b); return radixSort(b+1); } // radixSort /** Split the elements at the pth position pre: 0 <= b < # of places in the sequence representation of the data type post: For all i, the pth place in v[i] <= the pth place in v[i+1]- / public static void splitAndJoin(int p) { // Create the set of buckets Vector[] buckets = new Vector[POSSIBLE_PLACE_VALUES]; for(int i = 0; i < POSSIBLE_PLACE_VALUES; ++i) buckets[i] = new Vector(); // Paritition the vector for(int i = 0; i < size(); ++i) { buckets[elementAt(i).placeValue(p)].addElement(elementAt(i)); } // Put 'em back together setLength(0); for(int i = 0; i < POSSIBLE_PLACE_VALUES; ++i) { addElements(buckets[i]); } } // splitAndJoin
tail
of a list and then modify that tail, do we modify the original list?
// Assume l is the list 3,6,8,32 lprime = l.tail(); lprime.addToHead(new Integer(5)); System.out.println(l.tail().head());
// Assume l is the list 3,6,8,32 lprime = l.tail(); lprime.remove(new Integer(8)); System.out.println(l.contains(new Integer(8)));
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Wed Oct 8 12:19:11 1997.
This page generated on Wed Nov 5 12:38:35 1997 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu