home *** CD-ROM | disk | FTP | other *** search
- PRODUCT : TURBO PASCAL TUTOR NUMBER : 317
- VERSION : 2.00
- OS : PC-DOS
- DATE : July 17, 1986
-
- TITLE : RECURSION MODIFICATIONS
-
- The following is a list of modifications to be made to the file
- RECUR.EX in version 2.0 of the Turbo Pascal Tutor. The changes
- prevent the program from hanging after deleting the root of the
- binary tree.
-
- NOTE: This code modification updates your version of the Turbo
- Pascal Tutor to version 2.00A.
-
- 1. Make a backup copy of the file RECUR.EX.
- 2. Load the file RECUR.EX into the Turbo Pascal editor.
- 3. In the function LeftNode:
-
- Change from:
- .
- .
- .
- .
- .
- .
- Change to:
- .
- .
- .
- { Ver. 2.00A }
- . { Modification }
- .
- .
-
- 4. In the procedure LeftAndRightNil, change from:
- .
- .
- .
- if LeftNode(Node) then
- else
- .
- .
- .
-
-
- Change to:
- .
- .
- .
- if Node <> Root then { Ver. 2.00A Addition }
- begin { Ver. 2.00A Addition }
- if LeftNode(Node) then
- else
- end; { Ver. 2.00A Addition }
- .
- .
- .
-
- 5. In the procedure LeftNil, change from:
- .
- .
- .
- if LeftNode(Node) then
- else
- .
- .
- .
- Change to:
- .
- .
- .
- if Node <> Root then { Ver. 2.00A
- Addition }
- begin { Ver. 2.00A
- Addition }
- if LeftNode(Node) then
- else
- end; { Ver. 2.00A
- Addition }
- .
- .
- .
-
-
- 6. In the procedure RightNil, change from:
- .
- .
- .
- if LeftNode(Node) then
- else
- .
- .
- .
- Change to:
- .
- .
- .
- if Node <> Root then { Ver. 2.00A
- Addition }
- begin { Ver. 2.00A
- Addition }
- if LeftNode(Node) then
- else
- end; { Ver. 2.00A
- Addition }
- .
- .
- .
-
- 7. Save the file.
-