CS 280 Data Structures - PowerPoint PPT Presentation

About This Presentation
Title:

CS 280 Data Structures

Description:

Mistakes in the random data generator, particularly the almost sorted. Instance variables that shouldn't be. Bad variable names / cryptic code ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 7
Provided by: johnpe2
Learn more at: http://wiki.western.edu
Category:

less

Transcript and Presenter's Notes

Title: CS 280 Data Structures


1
CS 280Data 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 shouldnt 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 ComparableltTgt
  • 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 dont 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 havent
    covered some of this so you might have to guess
    part of the answer!)

5
Questions on the Practice Quiz
6
Complexity Practice
Write a Comment
User Comments (0)
About PowerShow.com