(Latest Revision: 11/05/2000)
Week 10 Notes for CS 2500 -- Fall 2000
Monday, November 06
- Take Roll.
- Check out this week's schedule
- Announcement(s)
- Final version of program #3 is due today.
- Quiz Wednesday: Carrano chapters 3-4 (data
abstraction and linked lists); and on
Andersen chapters 8-12, 17-21 (file system,
shell, editors, networking).
- Discuss implementations of the stack 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."
- PRO: can be done with an array-based list or with a
pointer-based list.
- Discuss Definition of the queue data type
- Organization -- First-In, First-Out
- Elements -- any given homogeneous set
- Operations
- constructor(s)
- destructor(s)
- bool QueueIsEmpty()
- void QueueInsert(queueItemType NewItem, bool& Success)
- void QueueDelete(bool& Success)
- void QueueDelete(queueItemType& QueueFront, bool& Success)
- void GetQueueFront(queueItemType& QueueFront, bool& Success)
- 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.
-
Wednesday, November 08
Friday, November 10
- NO CLASS TODAY -- In Observance of Veterans Day