Source Code for Data Structures and Problem Solving Using C#, Third Edition

LAST UPDATE: March 8, 2013 to change AnyType.default to default(AnyType)
BUG REPORTS ARE APPRECIATED!!

Here is the source code for Data Structures and Problem Solving Using C#, by Mark Allen Weiss. The materials here are copyrighted. I have successfully compiled and tested the programs with a protoype C# 2.0 compiler.

Complete Bundle

code.zip (not available, but winzip reads tar files)
code.tar
code.tar.Z

Compilation Batch File

compileVisual.bat

Chapter 1: Basic C#

FirstProgram.cs
MinTest.cs
OperatorTest.cs
TestSwap.cs

Chapter 2: References

RandomNumbers.cs
ReadStrings.cs
ReadStringsWithArrayList.cs
ReadStringsWithGenericList.cs
MatrixDemo.cs
ForeachDemo.cs
EchoDemo.cs
DivideByTwo.cs
MaxTest.cs
ListFiles.cs
DoubleSpace.cs

Chapter 3: Classes

IntCell.cs TestIntCell.cs
FancyIntCell.cs
DateDemo.cs
Exiting.cs TestExiting.cs
Ticket.cs
Squares.cs
StringArrayList.cs ReadStringsWithStringArrayList.cs

Chapter 4: Inheritance

TestException.cs
PersonDemo.cs
Shapes.cs ShapeDemo.cs
MemoryCell.cs TestMemoryCell.cs
SimpleArrayList.cs ReadStringsWithSimpleArrayList.cs
StorageCellDemo.cs
FindMaxDemo.cs
GenericMethods.cs
GenericFindMaxDemo.cs
GenericMemoryCell.cs TestGenericMemoryCell.cs
GenericSimpleArrayList.cs ReadStringsWithGenericSimpleArrayList.cs
FunctionObjectDemo.cs
FunctionObjectDemoWithNestedClasses.cs
StaticParamsDemo.cs

Chapter 5: Running Times

MaxSumTest.cs
BinarySearchDemo.cs

Chapter 6: The Collections API

IStack.cs StackDemo.cs
UnderflowException.cs
IQueue.cs QueueDemo.cs
GenericCollections.cs
EnumeratorDemo.cs
EqualsWithInheritance.cs
DictionaryDemo.cs
IPriorityQueue.cs PriorityQueueDemo.cs

Chapter 7: Recursion

RecSum.cs
PrintIntDemo.cs
FactorialDemo.cs
BinarySearchRecursive.cs
Ruler.cs
FractalStar.cs
Numerical.cs RSA.cs
MaxSumTest.cs
MakeChangeDemo.cs
Best.cs TicTacToeSlow.cs TicTacMainSlow.cs

Chapter 8: Sorting

DuplicateTest.cs
Sort.cs TestSort.cs

Chapter 9: Randomization

Random.cs
Numerical.cs RSA.cs

Chapter 10: Fun and Games

WordSearch.cs puz.txt
Best.cs TicTacToe.cs TicTacMain.cs

Chapter 11: Applications of Stacks -- Compilers and Parsing

Tokenizer.cs Balance.cs
Evaluator.cs

Chapter 12: Utilities

Hzip.cs
Tokenizer.cs Xref.cs

Chapter 13: Simulation

Josephus.cs
ModemSim.cs

Chapter 14: Shortest Path Algorithms

Graph.cs graph1.txt graph2.txt graph3.txt

Chapter 15: Nested Classes and Array-Based List Implementation

GenericCollections.cs

Chapter 16: Stacks

UnderflowException.cs
ArrayStack.cs
ListStack.cs
ArrayQueue.cs
ListQueue.cs
GenericCollections.cs

Chapter 17: Linked Lists

LinkedList.cs TestLinkedList.cs
SortedLinkedList.cs TestSortedLinkedList.cs

Chapter 18: Trees

BinaryTree.cs TestBinaryTree.cs
TestTreeIterators.cs

Chapter 19: Search Trees

DuplicateItemException.cs ItemNotFoundException.cs BinarySearchTree.cs TestBinarySearchTree.cs
BinarySearchTreeWithRank.cs TestBinarySearchTreeWithRank.cs
BinaryNode.cs Rotations.cs
RedBlackTree.cs TestRedBlackTree.cs
AATree.cs TestAATree.cs
GenericCollections.cs

Chapter 20: Hash Tables

GenericCollections.cs

Chapter 21: Heaps

BinaryHeap.cs TestBinaryHeap.cs

Chapter 22: Splay Trees

SplayTree.cs TestSplayTree.cs

Chapter 23: Pairing Heaps

IllegalValueException.cs PairingHeap.cs TestPairingHeap.cs

Chapter 24: Disjoint Sets

DisjointSetsSlow.cs
DisjointSets.cs