Class Notes (1,100,000)
CA (630,000)
UW (20,000)
CS (1,000)
CS138 (10)
Lecture 13

CS138 Lecture Notes - Lecture 13: Priority Queue, Linked List


Department
Computer Science
Course Code
CS138
Professor
Michael Godfrey
Lecture
13

This preview shows half of the first page. to view the full 3 pages of the document.
Data Lecture 13
February 26, 2013
Lists
Lists can be ordered by:
o Insertion time
Stacks
Queues
o Element key value
Sorted linked list
Binary Search Tree
o Combination
Priority queue
Getting linked structures right
o Often don’t notice bugs until much “later”
o Think defensively
Set ptrs to NULL if not going to be used immediately
Create “state reporting functions”
Use I/O & assertions to check
Draw pictures
Break down procedures by cases
Empty list
Insert at beginning
Last element
Testing
Create and maintain large number of test cases!
Regression Testing & Test-Driven Development
Waterfall model
Iterative model w/ mini-cycle of waterfall
Write the test case first
o Then write simplest possible code to pass the test
You're Reading a Preview

Unlock to view full version