Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lecture Notes on Testing a Sort Routine for Stability | COSC 350, Study notes of Data Structures and Algorithms

Material Type: Notes; Professor: Sloan; Class: Data Structures; Subject: Computer Science; University: Wofford College; Term: Fall 2008;

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-wvc-1
koofers-user-wvc-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS350: Data Structures Class Notes
Week 10, Class 28: Wednesday, November 5, 2008
Today we talked briefly about testing a sort routine for stability by using a dataset
composed of tuples and the sorting only on the first item using something like:
def newCmp(tuple1, tuple2):
return cmp(tuple1[0],tuple2[0])
Next, we discussed an ADT for a priority queue and went over the algorithms for
building, removing the root, and removing an arbitrary node. The key to removal is
restore completeness first, then the heap property by bubbling nodes.
Finally, we talked briefly about the ideas behind skip lists.
Homework for Friday: For the data: 5,1,9,3,7,2,4,8
a) Show the BST & heap tree
b) Show each after deleting 7
c) Show each after deleting

Partial preview of the text

Download Lecture Notes on Testing a Sort Routine for Stability | COSC 350 and more Study notes Data Structures and Algorithms in PDF only on Docsity!

CS350: Data Structures Class Notes

Week 10, Class 28: Wednesday, November 5, 2008 Today we talked briefly about testing a sort routine for stability by using a dataset composed of tuples and the sorting only on the first item using something like: def newCmp(tuple1, tuple2): return cmp(tuple1[0],tuple2[0]) Next, we discussed an ADT for a priority queue and went over the algorithms for building, removing the root, and removing an arbitrary node. The key to removal is restore completeness first, then the heap property by bubbling nodes. Finally, we talked briefly about the ideas behind skip lists. Homework for Friday: For the data: 5,1,9,3,7,2,4, a) Show the BST & heap tree b) Show each after deleting 7 c) Show each after deleting