Yurttas/PL/IL/Ada-95/ProgUnits/A/treeop 01.adb
Jump to navigation
Jump to search
1--
2-- Copyright (C) 1998
3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4--
5-- Permission to use, copy, modify, and distribute this
6-- software and its documentation for EDUCATIONAL purposes
7-- and without fee is hereby granted provided that this
8-- copyright notice appears in all copies.
9--
10--
11
12-- date : January 1, 1998.
13-- author : Salih Yurttas.
14
15-- purpose : creation of tree as nodes of information and
16-- searching in (pre,in,post)order for output.
17
18-- treeop_01.adb
19
20
21with Text_IO; use Text_IO;
22
23with TreeOp_01_P; use TreeOp_01_P;
24
25procedure TreeOp_01 is
26
27 Root : Ptr_Node;
28
29 procedure Out_Pre_Order is new Out_Nodes(Tree_Order => Pre_Order);
30
31 procedure Out_In_Order is new Out_Nodes(Tree_Order => In_Order);
32
33 procedure Out_Post_Order is new Out_Nodes(Tree_Order => Post_Order);
34
35begin
36
37 Enter(Root);
38
39 Out_Pre_Order(Root,"Nodes listed in preorder /");
40
41 Out_In_Order(Root,"Nodes listed in inorder /");
42
43 Out_Post_Order(Root,"Nodes listed in postorder /");
44
45 New_Line;
46
47end TreeOp_01;