Data Abstractions
CSCI 2320 -  Fall 2006 - Tentative Schedule

All Labs Due Next Class Period Unless Specified Otherwise!
 

 Class 

Topic's)

 Reading Assignments 
& Handouts

 Laboratory 
Assignments 

8/24

1-R

 Introduction To Class
Fill Out Questionnaire (Lab I-5 points)
Distribute & Discuss Course Outline

Basic Data Types
Range Of Acceptable Values
sizeof, limits.h
declarations,
initializations,
assignments
printf - control string
scanf - control string
puts, gets
constants vs variables
Documentation
Modules/Function Design
program components
Pass By Reference/Value
Modules with Pointers
Modules with Reference Variables

Stream Input - Output
cout << "\nEnter No";
cin >> No;
cin >> FirstName;
cin.getline(FullName);

String Functions
strlen, strcmp, strcpy

Course Outline

Lecture Slides OOP 1

Lecture Slides OOP 2

 

Install Visual Studio 2005 Net
On Your Computer By Next Monday

  Review Slides, Notes, Text For Quiz

All Labs Due Next Class Period Unless Specified Otherwise!

Questionnaire HW

OOP1 HW

Write Some Sample
C++ Programs

8/29

2-T

Aggregates : arrays, structs, classes
Student Struct - Set Function
Student Class - Set Method
Classes,
Member Functions = Methods
Class Data Members
Class Function Prototypes
Encapsulation
Constructors,
Destructors
public vs. private
scope operator
Function Overload
Function Signature
Default Arguments
Memory Leaks
Mutator Method
Accessor Method
ADT - Abstract Data Type
Operator Overloads
>, >=, <, <=, ==, !=, =

interface
class to hpp & cpp
#ifndef, #endif
4 Reasons To Create
.hpp & .cpp Class Interface

Indigenous Data
Exogenous Data
Standard Template Library

Lecture Slides OOP 2 Start Working On OOP2 HW
 Due Thursday
Review Slides, Notes, Text For Quiz
Most Of Quiz From Lab and OOP1

OOP 2 HW

8/31

3-R

Operator Overloads
>, >=, <, <=, ==, !=, =

interface
class to hpp & cpp
#ifndef, #endif
4 Reasons To Create
.hpp & .cpp Class Interface

Indigenous Data
Exogenous Data
Standard Template Library
 

Read PP 14 - 32 in your text MP3 Class Lab
Partially Done In Class?

Athlete Class Lab

9/5

4-T

Memory Management

Dynamic Memory
Shallow Copy
Deep Copy
LIFO & FIFO
Array Implementation Of A Stack
Dynamic Stack
Templates
Template Stack
Primitive Operations
Push, Pop, Empty

1.
Stack Study For Quiz

9/7

5-R

Dynamic Memory
Shallow Copy
Deep Copy
LIFO & FIFO
Array Implementation Of A Stack
Dynamic Stack
Templates
Template Stack
Primitive Operations
Push, Pop, Empty
Full, Resize, Overload =

Text Files (if Time)

Memory Management

Review Slides
Stack
Stack I Lab
Due Tuesday

Stack HW
Due Thursday
Do Most Of Stack HW For Tuesday

9/12

6-T

Shallow Copy
Deep Copy
Stack Resize
Stack Overload =
Copy Constructor
Dynamic Memory

Direct Access Files

Why Direct Access Files?
Why Direct Access Files, As Opposed To Text Files?
Download Application
Visual Studio Projects Re-visited
Execute Binary Outside Visual Studio Net Environment
Redirecting Output To A Text File
Other Files In The Debug Folder
fopen & fclose- Open To Create New File Close File (wb+)
fseek – moving the Read-Write Pointer
fwrite – Writing Direct Access Records
fopen & fclose- Open To Create New File Close File (rb+)
fread – Reading Direct Access Records
Generic Template ReadRecord, WriteRecord, & FileLength

FILE  *FilePtr;
FilePtr = fopen (NewFileName,"rb+");
FilePtr = fopen (NewFileName,"wb+");
fseek(FilePtr, 4 * sizeof(Student), SEEK_SET);
fwrite(&Students,sizeof(Student),(long)1,FilePtr);
fread(&Students,sizeof(Student),(long)1,FilePtr);
fclose(FilePtr);

Direct Access Files

Why Direct Access Files?
Why Direct Access Files, As Opposed To Text Files?
Download Application
Visual Studio Projects Re-visited
Execute Binary Outside Visual Studio Net Environment
Redirecting Output To A Text File
Other Files In The Debug Folder
fopen & fclose- Open To Create New File Close File (wb+)
fseek – moving the Read-Write Pointer
fwrite – Writing Direct Access Records
fopen & fclose- Open To Create New File Close File (rb+)
fread – Reading Direct Access Records
Generic Template ReadRecord, WriteRecord, & FileLength

FILE  *FilePtr;
FilePtr = fopen (NewFileName,"rb+");
FilePtr = fopen (NewFileName,"wb+");
fseek(FilePtr, 4 * sizeof(Student), SEEK_SET);
fwrite(&Students,sizeof(Student),(long)1,FilePtr);
fread(&Students,sizeof(Student),(long)1,FilePtr);
fclose(FilePtr);
Lecture Slides Direct Access  Files

Optional
Chap08
TextFiles

Optional
Chap11
Direct Access Files
  

Advanced Stack Lab

Study For Quiz

9/14

7-R


Why Direct Access Files?
Why Direct Access Files, As Opposed To Text Files?
Download Application
Visual Studio Projects Re-visited
Execute Binary Outside Visual Studio Net Environment
Redirecting Output To A Text File
Other Files In The Debug Folder
fopen & fclose- Open To Create New File Close File (wb+)
fseek – moving the Read-Write Pointer
fwrite – Writing Direct Access Records
fopen & fclose- Open To Create New File Close File (rb+)
fread – Reading Direct Access Records
Generic Template ReadRecord, WriteRecord, & FileLength

FILE  *FilePtr;
FilePtr = fopen (NewFileName,"rb+");
FilePtr = fopen (NewFileName,"wb+");
fseek(FilePtr, 4 * sizeof(Student), SEEK_SET);
fwrite(&Students,sizeof(Student),(long)1,FilePtr);
fread(&Students,sizeof(Student),(long)1,FilePtr);
fclose(FilePtr);

Direct Access Files

Why Direct Access Files?
Why Direct Access Files, As Opposed To Text Files?
Download Application
Visual Studio Projects Re-visited
Execute Binary Outside Visual Studio Net Environment
Redirecting Output To A Text File
Other Files In The Debug Folder
fopen & fclose- Open To Create New File Close File (wb+)
fseek – moving the Read-Write Pointer
fwrite – Writing Direct Access Records
fopen & fclose- Open To Create New File Close File (rb+)
fread – Reading Direct Access Records
Generic Template ReadRecord, WriteRecord, & FileLength

FILE  *FilePtr;
FilePtr = fopen (NewFileName,"rb+");
FilePtr = fopen (NewFileName,"wb+");
fseek(FilePtr, 4 * sizeof(Student), SEEK_SET);
fwrite(&Students,sizeof(Student),(long)1,FilePtr);
fread(&Students,sizeof(Student),(long)1,FilePtr);
fclose(FilePtr);
Lecture Slides Direct Access  Files

Optional
Chap08
TextFiles

Optional
Chap11
Direct Access Files
  

 

 

9/19

8-T

Calculate Average Search Time
For Random Files
Random Number Function
Programs Which Create Random Files
  Dir-Access File Lab

9/21

9-R

Factors That Influence Average Drive Access Times
Drive Optimization/Defragmentation
Fragmenting A Drive

Header Nodes
DLNodes
DLList Class With Direct Access Files
  MP3-Direct-Access-Time-2 Lab

9/26

10-T

 Inheritance
Develop AthleteListHeader class

DA-DLList Constructors & Destructors
  DLList-DirAcc-1 Lab

9/28

11-R

Internal Memory Doubly Linked Lists
Memory Management: GetNode, FreeNode

NodePtr GetNode (void):
void FreeNode (OldNodePtr):

Direct Access File DLList

   

10/3

12-T

Exam I   DLList-DirAcc 2 Lab

10/5

13-R

Internal Memory Doubly Linked Lists
Memory Management: GetNode, FreeNode
ValidHeaderPtrs , ValidNodePtrs
Stack Emulation: Push, Pop, Empty

NodePtr GetNode (void):
void FreeNode (OldNodePtr):
bool Push (HeaderNo, NewInfo):
bool Pop (HeaderNo, OldInfo):

Modeling To Direct Access Files

   

10/10

14-T

Internal Memory Doubly Linked Lists
Queue Emulation: Insert, Remove
Linked List Emulation: InsertAfter, Inplace

bool Insert (HeaderNo, NewInfo):
bool Remove (HeaderNo, OldInfo):
bool InsertAfter (HeaderNo, NewInfo,LeftBrother):
bool Inplace (HeaderNo, NewInfo):

Timing Practice Examples

  DLList-DirAcc 3 Lab

10/12

15-R

Mid Semester Break 10/13

Delete (HeaderNo, RecordNo)
PseudoCode/Logic

KeyTables  (Key, Ptr)
KeyTable.AddKeyToTable(Key, Ptr)
KeyTable.DeleteKeyFromTable(Key)

Inventory Order Example
Standard Template Library Limitations

Timing Insert, Delete, Search, Sorting
General Case Solutions
For Unordered Direct Access File,
Ordered Direct Access File,
DLList Direct Access File
 Implementations

   

10/17

16-T

Binary Tree Terminology
Son, Father, Decendent,Ancestor, Balanced, Skew
Internal Memory Binary Tree Application

Change ListHeader To TreeHeader - Only
One Pointer -> Root
Same GetNode, FreeNode, Constructor, Destructor, DisplayHeaders, DisplayNodes, ValidHeader, ValidNodes.

bool Insert (HeaderNo, NewInfo):
bool SetLeft (HeaderNo, NewInfo,Father):
bool SetRight (HeaderNo, NewInfo,Father):

Random Tree Search Time - Knuth

Start Tree Traversals

   

10/19

17-R

Internal Memory Binary Trees
InOrder Traversal
PreOrder Traversal
PostOrder Traversal

Direct Access Binary Tree Applications
InOrder Traversal
PreOrder Traversal
PostOrder Traversal 

Non-Recursive Tree Traversals

Left InThreaded Binary Tree
General Tree

BinTreeTraversals DA-BinTree 1 Lab
Due 10/24

10/24

T

Two Russians named Adelson-Velskii and Landis.

An empty tree is height balanced.

For a tree T, T-L shall denote the left subtree and T-R shall denote the right subtree.

For a tree T, h-L shall denote the height of the left subtree (T-L) and h-R shall denote the height of the right subtree (T-R).

A non empty binary tree is HEIGHT BALANCED if and only if
T-R and T-L are height balanced
-1 <= (h-L) - (h-R)| <= +1

The BALANCE FACTOR of a node T in a binary tree bf(T) = h-L - h-R.

 For any node T in an AVL tree, bf(T) = -1, 0, or +1

Introduction To AVL Trees
Rotate Left

Introduction To AVL Trees
Rotate Left
Rotate Right
Double Rotate Left
Double Rotate Right

AVLTrees

RotateLeft

RotateRight

DoubleRotateRight

 

10/26

R

Exam II    

10/31

18-T

InClass Lab 1/2 Class

________________________

Two Russians named Adelson-Velskii and Landis.

An empty tree is height balanced.

For a tree T, T-L shall denote the left subtree and T-R shall denote the right subtree.

For a tree T, h-L shall denote the height of the left subtree (T-L) and h-R shall denote the height of the right subtree (T-R).

A non empty binary tree is HEIGHT BALANCED if and only if
T-R and T-L are height balanced
-1 <= (h-L) - (h-R)| <= +1

The BALANCE FACTOR of a node T in a binary tree bf(T) = h-L - h-R.

 For any node T in an AVL tree, bf(T) = -1, 0, or +1

Introduction To AVL Trees
Rotate Left

Introduction To AVL Trees
Rotate Left
Rotate Right
Double Rotate Left
Double Rotate Right

AVLTrees

RotateLeft

RotateRight

DoubleRotateRight

DA-BinTree2 Lab
Due 10/31

11/2

19-R

Shortest Path - Graph
Shortest Path - Weighted Digraph
Connected Graph
Chromatic Number
Complete Graph
Degree = Indegree + Outdegree
Adjacency Matrix
Matrix Multiplication 
Matrix Add & Matrix Sub

Matrix Multiplication 
Matrix Add & Matrix Sub
In-Class Adjacency Lab

GraphTheory1 DA-AVLTree1 Lab
Due 11/19

11/7

20-T

Shortest Path - Graph
Shortest Path - Weighted Digraph
Connected Graph
Chromatic Number
Complete Graph
Degree = Indegree + Outdegree
Adjacency Matrix
Matrix Multiplication 
Matrix Add & Matrix Sub

Matrix Multiplication 
Matrix Add & Matrix Sub
In-Class Adjacency Lab

   

11/9

21-R

M-Way Trees
B Trees
B Tree Insertion
B+ Trees
B+ Tree Insertion

Calculate M For Given Buffer Size

B/B+ Tree DA-AVLTree2 Lab
Due 11/14


DA-AVLTree3 Lab
Due 11/16

11/14

22-T

Planar Graphs,
E-Mail Routing Problem
Airline Shortest Path
Airline Fastest Flight
Airline Cheapest Flight
Sparse Graph
Dense Graph
Adjacency Matrix Order N*N
Adjacency List 
Adjacency List Implementation
Adjacency List 
Order N Ptrs + Order E Nodes
Data Dictionary
Implement Data Dictionary
Build Data Dictionary From Inputs
Dykstra's Shortest Path 
Algorithm

Matrix Multiplication 
Matrix Add & Matrix Sub

Graph Theory 2 B+ Tree HW


DA-AVLTree4 Lab
Due 11/21

11/16

23-R

Review B/B+ Trees
Graph Paths
Quiz
Dijkstra Applet
   

11/21

24-T

Introduction To Hashing
For Large Populations Of Data
Success Is Not Always Possible

Loading Factor >= 80%
Access Quotient 1.2 or better
Hash Clash/Collision
Hashing Techniques
Mod, Truncation, Folding, Nearest Prime
Collision Resolution
Linear Probing,
Quadratic Probing
Linked List Overflow
Binary Tree Overflow
AVL Tree Overflow
In-Class Lab Hashing-HW
Due 11/30

11/23

25-R

Thanksgiving - No Class    

11/28

26-T

Introduction To Hashing
Loading Factor >= 80%
Access Quotient 1.2 or better
Hash Clash/Collision
Hashing Techniques
Mod, Truncation, Folding, Nearest Prime
Collision Resolution
Linear Probing,
Quadratic Probing
Linked List Overflow
Binary Tree Overflow
AVL Tree Overflow
In-Class Lab  

11/30

27-R

Exam III    

12/5

28-T

     

12/6
12/7

Reading Days Reading Days Reading Days

All Labs & Homework Due Next Class Period Unless Specified Otherwise!
No assignments will be accepted after 5/1/2006 Noon