readme.txt
来自「数据结构c++语言描述的源代码」· 文本 代码 · 共 196 行
TXT
196 行
LIST OF ALL C++ PROGRAMS IN CHAPTER 3
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 3
Program 3.1 Formula-based class LinearList
file: llist.h, llist.cpp
Program 3.2 Cause new to throw NoMem exceptions instead of xalloc exceptions
file: xcept.h
Program 3.3 Elementary list operations
file: llist.h, llist.cpp
Program 3.4 Deletion from a linear list
file: llist.h, llist.cpp
Program 3.5 Insertion into a linear list
file: llist.h, llist.cpp
Program 3.6 Inserting a list into the output stream
file: llist.h, llist.cpp
Program 3.7 Example using the class LinearList
file: llist.cpp, llist.cpp
Program 3.8 Class definitions for a chain
file: cnode.h, chain.h, chain.cpp
Program 3.9 Delete all nodes in a chain
file: chain.h, chain.cpp
Program 3.10 Determine the length of a chain
file: chain.h, chain.cpp
Program 3.11 Find the kth element of a chain
file: chain.h, chain.cpp
Program 3.12 Search a chain
file: chain.h, chain.cpp
Program 3.13 Output a chain
file: chain.h, chain.cpp
Program 3.14 Deletion from a chain
file: chain.h, chain.cpp
Program 3.15 Insert into a chain
file: chain.h, chain.cpp
Program 3.16 Deleting the nodes in a chain
file: echain.h, echain.cpp
Program 3.17 Add an element to the right end
file: echain.h, echain.cpp
Program 3.18 Chain iterator class
file: citer.h, citer.cpp
Program 3.19 Outputting the integer chain X using a chain iterator
file: chainout.cpp
Program 3.20 Searching a circular linked list with a head node
file: clist.h
Program 3.21 Class definition for doubly linked lists
file: dnode.h, double.h
Program 3.22 Class definition for an indirectly addressed list
file: indlist.h, indlist.cpp
Program 3.23 Constructor and destructor for indirect addressing
file: indlist.h, indlist.cpp
Program 3.24 Find operation for indirect lists
file: indlist.h, indlist.cpp
Program 3.25 Deletion from an indirect list
file: indlist.h, indlist.cpp
Program 3.26 Insertion into an indirectly addressed list
file: indlist.h, indlist.cpp
Program 3.27 Class definition for simulated pointers
file: snode.h, simul.h, simul.cpp
Program 3.28 Initialize available space list
file: simul.h, simul.cpp
Program 3.29 Allocate a node using simulated pointers
file: simul.h, simul.cpp
Program 3.30 Deallocate a node with simulated pointers
file: simul.h, simul.cpp
Program 3.31 Initialization of dual available space list
file: dsimul.h, dsimul.cpp
Program 3.32 Dual available space list version of Allocate
file: dsimul.h, dsimul.cpp
Program 3.33 Deallocate a circular list
file: dsimul.h, dsimul.cpp
Program 3.34 Class definition for simulated chains
file: schain.h, schain.cpp
Program 3.35 Destructor and length using simulated pointers
file: schain.h, schain.cpp
Program 3.36 Find using simulated pointers
file: schain.h, schain.cpp
Program 3.37 Delete using simulated pointers
file: schain.h, schain.cpp
Program 3.38 Insert using simulated pointers
file: schain.h, schain.cpp
Program 3.39 Using a simulated chain
file: schain.cpp
Program 3.40 Possible node class for bin sort
file binnode1.h
Program 3.41 An alternative way to handle operator overloading
file binnode2.h
Program 3.42 Another way to handle operator overloading
file binnode3.h
Program 3.43 Bin sort using class definitions
file: binsort1.cpp
Program 3.44 Bin sort as a class member of Chain
file: nchain.h, binsort2.cpp
Program 3.45 Sorting on different fields
file: binnode4.h, mchain.h, binsort3.cpp
Program 3.46 Online equivalence class functions using arrays
file: union1.cpp
Program 3.47 Online equivalence class functions using chains
file: union2.cpp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?