📄 readme.txt
字号:
LIST OF ALL C++ PROGRAMS IN CHAPTER 12
All programs were originally developed and tested using
Borland C++ version 5.01 for Windows 95. The codes in this
directory have been altered as necessary so that they would compile and
execute properly with Microsoft's Visual C++ Version 5.0.
The primary changes result from the following:
1. The new function returns 0 on failure instead of throwing
the xalloc exception.
2. The set new handler function has a different format.
3. Visual C++ does not recognize the fact that when an exception
is thrown, control cannot return to the throw point. As a result,
the compiler gives the error ``not all control paths return a value''
when compiling several of the original methods. To get around
this problem, unreachable return statements have been added.
4. Visual C++ has a different scoping rule for loop indexes
declared within the loop header. For example the loop index i
declared as below
for (int i = 0; i <= n; i++) {
...
}
is available outside the for loop block. This causes a variable
redefined error if we have another for loop with the header
for (int i ...)
To overcome this problem, the ``int'' from succeeding for loops
has been deleted.
5. The max and min functions are not included in stdlib.h.
Therefore, equivalent functions have been defined and placed
in the file dosmax.h.
6. Visual C++ appears to have problems resolving template functions
at times. For example, some of the functions in binary.h, bbloadd.cpp
and bbknap.cpp had to be changed from template functions to
integer functions to get them to compile.
7. Visual C++ appears to have problems deleting arrays of type T
when T has a default destructor. For example, deleting
the chain iterator array Pos (see DeactivatePos) in lnbase
causes a crash. A null destructor has been defined in citer1.h
to overcome this problem.
For programs that require input to be provided, sample input is given in the
corresponding .dat file. This sample input is NOT intended to constitute
an adequate test set. For information on designing test data, see
Section 1.5 of the text. To run the codes, you may need some of the .h files
from earlier chapters.
The output generated by each program is given in the corresponding .out file.
CHAPTER 12
Program 12.1 Cost-adjacency matrix for weighted directed graphs
file: awdgraph.h, awdgraph.cpp
Program 12.2 Cost-adjacency matrix for weighted graphs
file: awgraph.h, awgraph.cpp
Program 12.3 Adjacency-matrix representation of a digraph
file: adigraph.h, adigraph.cpp
Program 12.4 Adjacency-matrix representation of a graph
file: agraph.h, agraph.cpp
Program 12.5 Deleting from a chain by key
file: fchain.h
Program 12.6 Base class for linked-adjacency representations
file: lbase.h
Program 12.7 Linked-adjacency-list representation of a digraph
file: ldigraph.h, ldigraph.cpp
Program 12.8 The class LinkedGraph
file: lgraph.h, lgraph.cpp
Program 12.9 Linked-adjacency lists for weighted digraphs
file: lwdgraph.h, lwdgraph.cpp
(lwgraph.h, lwgraph.cpp ... linked weighted undirected graphs)
Program 12.10 The class GraphNode
file: gnode.h
Program 12.11 Iterators for adjacency-matrix representations
file: awd.h
Program 12.12 Additions to LinkedBase
file: lnbase.h
Program 12.13 Linked-adjacency-list iterators
file: ldg.h
Program 12.14 Linked-weighted-digraph iterators
file: lwdg.h
Program 12.15 The abstract class Network
file: network.h
Program 12.16 The abstract class AbstractList
file: abslist.h, absllist.h, abschain.h, absllist.cpp. abschain.cpp
Program 12.16 Breadth-first search
file: network.h, abfs.cpp, abfs.dat, dwbfs.cpp, dwbfs.dat
Program 12.17 Direct implementation of breadth-first search for
adjacency-matrix representations
file: awdbfs.h
Program 12.18 Direct BFS implementations for linked graphs and digraphs
file: ldgbfs.h
Program 12.19 Depth-first search
file: network.h, ldfs.cpp, ldfs.dat, adfs.cpp, adfs.dat
Program 12.20 Find a path in a graph
file: network.h, gpath.cpp, gpath.dat
Program 12.21 Determine whether an undirected graph is connected
file: undirect.h, connect.cpp, connect.dat
Program 12.22 Component labeling
file: undirect.h, glabel.cpp, glabel.dat
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -