(Latest Revision: 05/04/2001)
Week 11 Notes for CS 2500, Section 001 -- Spring 2001
CS 2500, Section 001, Monday, April 30, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- Discuss applications of the queue data type
- Ready queue in an OS
- Resource queues -- e.g. student registration system
- Simulations -- e.g. traffic, airport, bank
- Radix Sort
- breadth-first search
- Discuss implementations of the queue data type
- array-based implementation
- pointer-based implementation
- "as-a-list" implementations
- Discuss pro's and con's of different implementations
- array-based implementation
- PRO: simple code
- PRO: all operations are O(1)
- CON: static allocation
- pointer-based implementation
- PRO: dynamic memory allocation
- PRO: most operations are O(1)
- CON: destructor is O(N)
- CON: extra memory required for each element.
- "as-a-list" implementations
- PRO: extremely easy to program
- PRO: if done a certain way, can be as efficient as coding
"from scratch." -- take care to make both insertion
and deletion efficient.
- PRO: can be done with an array-based list or with a
pointer-based list.
-
- Start on Trees if time allows
-
CS 2500, Section 001, Wednesday, May 02, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- Examine some of the interesting sections of implementation code of
queues.
- Discuss some of the coding problems for the deque assignment
- Discuss applications of the queue data type
- Ready queue in an OS
- Resource queues -- e.g. student registration system
- Simulations -- e.g. traffic, airport, bank
- Radix Sort
- breadth-first search
- Discuss pro's and con's of different queue implementations
- array-based implementation
- PRO: simple code
- PRO: all operations are O(1)
- CON: static allocation
- pointer-based implementation
- PRO: dynamic memory allocation
- PRO: most operations are O(1)
- CON: destructor is O(N)
- CON: extra memory required for each element.
- "as-a-list" implementations
- PRO: extremely easy to program
- PRO: if done a certain way, can be as efficient as coding
"from scratch." -- take care to make both insertion
and deletion efficient.
- PRO: can be done with an array-based list or with a
pointer-based list.
-
- Start on Trees if time allows
-
CS 2500, Section 001, Friday, May 04, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- I'm working on arranging for my absence next week.
-
- Discuss binary trees, tables, and binary search trees.
- ADT binary tree -- the ADT is determined by these properties
- Organization -- A binary tree is empty, or consists of a
root with a left subtree and a right subtree. The subtrees
are binary trees.
- Elements -- any given homogeneous set
- Operations -- see the file BT.h for the list and the specs.
- ADT table -- see the specs in Carrano, Chapter 11, p. 529.
- ADT binary search tree
- Organization -- A binary search tree is a binary tree in
which each node contains a key that is an element of a totally
ordered set. For every node N in the tree, all keys in the
left subtree of N are less than the key in N, and all keys in
the right subtree of N are greater than the key in N.
- Elements -- any given homogeneous set
- Operations -- see the file BST.h for the list and the specs.
- Discuss implementation of retrieval.
- Discuss implementation of insertion.
- Discuss implementation of traversal.
- Discuss implementation of deletion.
- What is the reason for using BST's?
-