Download presentation
Presentation is loading. Please wait.
1
CS 280 Data Structures Professor John Peterson
2
Grading the Projects Boo-boos: Not allowing bubble sort to exit soon enough Mistakes in the heapify, especially stage 2 Mistakes in the random data generator, particularly the almost sorted. Instance variables that shouldn’t be Bad variable names / cryptic code Not keeping track of numSwaps / compares Not deleting useless code from a project Casting – always an error except (int) to convert float to int. Copying in illogical places (should be in new Snapshot)
3
Homework Wrapup interface Comparable { public boolean gtr(T x, T y); } class Student { public int studentNumber; public String studentName; } Comparable to sort students by number. Comparable to sort students by name. Sort students given an array of students and a Comparable object. Write the signature of a general sort method using arrays and a comparable
4
Generic Methods Suppose we don’t know what sort of object is being sorted but we do know that the sort will take an array of these objects and a Comparable – how would you write the signature of this more general sort method? (Warning – we haven’t covered some of this so you might have to guess part of the answer!)
5
Questions on the Practice Quiz
6
Complexity Practice
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.