File: aug30.txt Author: Jeff Kinne Contents: plan/notes for the day * HW1, HW2 answers * HW grading - grade in BB, notes on what points taken off for in hw1Grading.txt, hw2Grading.txt, etc. in the in-class code on the website. * Basic review of data structures... Hash table linked-list array BST (bad) BST (good) ------------------------------------------------------------------------------- insert worst O(1) O(1) O(1) O(n) O(log n) insert avg O(1) O(1) O(1) ? O(log n) ? O(log n) find 991 worst O(n) O(n) O(1) O(n) O(log n) find 991 avg O(1) O(n) O(1) ? O(log n) ? O(log n) find GPA O(n) O(n) O(M) O(n) O(n) memory O(n) O(n) O(M) O(n) O(n) M = maximum 991 # * Test queries from book: http://theory.indstate.edu/cs457.php * Some SQL examples left from last time... + People that have one the Nobel more than once. SELECT N.winner, N.subject, N.yr FROM nobel AS N, nobel AS M WHERE N.winner = M.winner AND (N.yr != M.yr OR N.subject != M.subject) + Econ class with most sections this semester SELECT course_id, count(course_id) as num FROM section GROUP BY course_id GROUP BY course_id ORDER BY num DESC SELECT winner, count(winner) as num FROM nobel GROUP BY winner ORDER BY num DESC * Plan for next time - still going through SQL stuff, expect a HW3 and HW4 with some more SQL queries to try...