Table of Contents 2336 Example Program Booklet Foreman

advertisement
Table of Contents
2336 Example Program Booklet
Descriptive Files and Algorithms
Foreman
Page
2336 Course Calendar and Schedule
2336 General Information
2336 Course Topic Outline
Departmental Policy on Academic Honesty
Java Grading Guidelines
1
2
4
7
8
Program 1
Program 2
Program 3
Program 4
Program 5
Program 6
Program 7
10
12
15
16
18
19
23
Evaluate parenthesized logical expression w stacks
Long Decimal Numbers in a DLL class
Static version of 2
Lattice Construction and Random Numbers
Open Hashing with TSTs
Event Driven Simulation using a Priority Queue
All Pairs – Shortest Paths Algorithm
Language Primitive Data Structures
Introduction to Algorithm Analysis
Pointer Sort Construction Algorithm
Address Calculation Sorts
Sort Summary
25
33
40
42
45
Hashing Algorithms (Open/Dynamic and Closed/Static)
The Bin or Radix Sort Algorithm
Priority Queue
Tree and Graph Definitions
What Is a Code?
54
59
63
65
71
Huffman Code Algorithm (Greedy)
AVL trees (Height Balanced Binary Search Trees)
Graph Classification and Implementation Schemes
Kruskal’s Minimum Spanning tree Algorithm (Greedy)
Dijkstra’s Single source Shortest Paths Graph Algorithm (Greedy)
75
77
79
84
86
All Pairs - Shortest Paths Graph Algorithm (Dynamic Programming)
Optimal BST (Dynamic programming)
How to Implement Sets in C++ and Java
Introduction to Game Trees
Practicums 1..4
88
91
96
98
105
i
Netbeans Example Projects (Most have a main driver. Some
StackAO
Postfix
QueueAO
PondsIslands
Recursive
have I/O files)
Stack class using an array of objects
An interesting example using StackAO
Queue class using an array of objects
Interesting example program using QueueAO
Examples of Recursive Functions & exceptions
DllOfIntegers
An Ordered Circular DLLof unique integers
ArrayListDemo
Shows some of the common methods
DllOfIntegersStatic Static version of the program above
DllComparable
Ordered Circular DLL of any Comparable type
BstOfIntegers
Binary Search Tree of Integers
Utilities
Class library containing the following:
AtomicUtilities low level utilities
IntArrayUtilities input, output, sum, etc. of integer arrays
IntArraySorts
2 bubble, 3 insertion and 1 selection sort of int array
IntArrayAsTree Display a tree stored in an integer array
AOutiliites
Similar to intArrayUtilities but on arrays of objects
ComparableSorts Simple sorts of any comparable type
ComparableTree Builds a BST of any Comparable Type
SimpleSortsComparable
driver for the in Utilities Library
BstComparable
Bst of Strings, but could be of anything Comparable
BinarySearch.cpp Iterative and Recursive Binary Search of a Sorted Array
QuickSort.cpp
Simple version. A Divide & Conquer algorithm
MergeSort.cpp
Linked List version, another Divide and Conquer alg.
HeapSort.cpp
Standard version of the algorithm. Displays the tree
DepthFirst
BreadthFirst
SllGraphNode
Queens
Depth First traversal of an SLL based Graph
Breadth First Traversal of an SLL based Graph
Node and Edge classes used by the traversals above.
Backtracking Solution to the Eight Queens Puzzle
Page
109
114
118
123
129
139
148
151
154
173
186
188
191
195
198
200
204
208
213
222
225
229
233
238
241
244
248
Data Files
Int50.txt
Emp50.txt
260
261
Other example programs can be found under my section of cs.lamar.edu.
ii
Download