readme.txt
来自「数据结构c++语言描述的源代码」· 文本 代码 · 共 144 行
TXT
144 行
LIST OF ALL C++ PROGRAMS IN CHAPTER 4
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 4
Program 4.1 A one-dimensional array class
file: array1d.h, array1d.cpp
Program 4.2 Constructors for a one-dimensional array
file: array1d.h, array1d.cpp
Program 4.3 Overloading the array indexing operator
file: array1d.h, array1d.cpp
Program 4.4 Overloading the assignment operator
file: array1d.h, array1d.cpp
Program 4.5 Overloading binary minus, unary minus, and increment
file: array2d.h, array2d.cpp
Program 4.6 A class for two-dimensional arrays
file: array2d.h, array2d.cpp
Program 4.7 Constructor for a two-dimensional array
file: array2d.h, array2d.cpp
Program 4.8 Copy constructor for two-dimensional arrays
file: array2d.h, array2d.cpp
Program 4.9 Overloading [] for a two-dimensional array
file: array2d.h, array2d.cpp
Program 4.10 Subtraction
file: array2d.h, array2d.cpp
Program 4.11 Matrix multiplication
file: array2d.h, array2d.cpp
Program 4.12 The class Matrix
file: matrix.h, matrix.cpp
Program 4.13 Matrix constructor
file: matrix.h, matrix.cpp
Program 4.14 Indexing a matrix
file: matrix.h, matrix.cpp
Program 4.15 Matrix subtraction
file: matrix.h, matrix.cpp
Program 4.16 Matrix multiplication
file: matrix.h, matrix.cpp
Program 4.17 The class DiagonalMatrix
file: diag.h, diag.cpp
Program 4.18 The class TridiagonalMatrix
file: tridiag.h, tridiag.cpp
Program 4.19 The class LowerMatrix
file: lower.h, lower.cpp
Program 4.20 The class SparseMatrix
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.21 SparseMatrix constructor
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.22 SparseMatrix input and output codes
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.23 Transposing a sparse matrix
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.24 Appending a non-zero term
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.25 Adding two sparse matrices
file: smatrix.h, smatrix.cpp, smatrix.dat
Program 4.26 Chain nodes used in sparse matrix representation
file: matnodes.h, lsmatrix.h, lsmatrix.cpp, lsmatrix.dat
Program 4.27 Class definition for a linked sparse matrix
file: lsmatrix.h, lsmatrix.cpp, lsmatrix.dat
Program 4.28 Input a sparse matrix
file: lsmatrix.h, lsmatrix.cpp, lsmatrix.dat
Program 4.29 Output a sparse matrix
file: lsmatrix.h, lsmatrix.cpp, lsmatrix.dat
Program 4.30 Transpose a sparse matrix
file: lsmatrix.h, lsmatrix.cpp, lsmatrix.dat
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?