CS 245 Lecture 28 – Heap Demo and Closeout
Agenda what ?s removing from a heap heap demo data structure decision tree advice Code BiggerOrBetter.java Heap.java Circle.java Circles.java Advice Rob Pike, in Notes on Programming in C: Fancy algorithms are slow when n is small, and n is usually small. Donald Knuth, in Structured Programming with Goto Statements: Programmers waste enormous amounts of time thinking about, or worrying […]
CS 245 Lecture 27 – Heap Implementation
Agenda what ?s data structure utility belt what does this do? implementing a heap using an ArrayList size isEmpty clear finding children of a parent and parent of a child add remove What Does This Do? Code Heap.java Haiku
CS 245 Lecture 26 – Heaps and Priority Queues
Agenda what ?s interview questions program this design this heaps TODO Read section 6.5 in the data structures book. 1/4 sheet. Program This Design This Code … Haiku
CS 245 Lab 13 – Binary Search Trees
First, if you have checkpoints left over from last lab, get them inspected during the second 15 minutes of this lab. Don’t forget to work in pairs! Where possible, please work with someone that you did not work with last week. The exchange of new ideas and perspectives is not an opportunity you want to […]
CS 245 Lecture 25 – Binary Search Tree Add, Traverse
Agenda what ?s schedule homework (* this week, 1 next week, 1 during finals) last lab tomorrow final: Friday at 1 PM hw3 demo adding nodes to a BST iterating through a BST deleting nodes from a BST Code KeyValueVisitor.java BinarySearchTree.java Haiku
CS 245 Homework 3 – due before December 14
See the PDF.
CS 245 Lecture 24 – Binary Search Trees
Agenda what ?s design this isKitten binary search tree vs. sorted array implementing a BST Node isEmpty size get add delete a problem with BSTs: balance Design This Code HashEg.java BinarySearchTree.java Haiku
CS 245 Lecture 23 – Binary Search Trees
Agenda what ?s what does this do? what if we don’t override equals? what if we don’t override hashcode? hashes as a generalization of arrays hashes in C++ hashes in PHP hash/object duality in JavaScript binary search over linked structures the binary search tree What Does This Do? Hash Links Arrays as maps in PHP […]
CS 245 Lab 12 – Threaded Image Processing
First, if you have checkpoints left over from last lab, get them inspected during the first 15 minutes of this lab. Don’t forget to work in pairs! Where possible, please work with someone that you did not work with last week. The exchange of new ideas and perspectives is not an opportunity you want to […]
CS 245 Lecture 22 – Hashtables
Agenda what ?s turning keys into integers turning integers into indices handling collisions of indices chaining vs. linear probing finding word frequencies in Project Gutenberg TODO Read chapter 14 through section 14.2. 1/4 sheet. Lab exercise will be easier if you read this before then. Code Map.java Fastmap.java CountedWord.java FrequentWordFinder.java Haiku