How Can We Represent Trees?
We can use sequential lists, linked lists, and indexes to represent trees. When using sequential lists, we
duplicate many data; and furthermore, sequential lists are not used by DBMS products to represent
trees. Therefore, we describe only linked lists and indexes.
Linked-List Representation of Trees.
Figure H-18 shows a tree structure in which the VENDOR records are parents and the INVOICE records
are children. Figure H-19 shows two occurrences of this structure, and all of the VENDOR and INVOICE
records have been written to a direct access file in Figure H-20. VENDOR AA is in relative record number
1 (RRN1), and VENDOR BB is in relative record number 2. The INVOICE records have been stored in subsequent records, as illustrated. Note that these records are not stored in any particular order and that
they do not need to be.
How Can We Represent Trees?We can use sequential lists, linked lists, and indexes to represent trees. When using sequential lists, we duplicate many data; and furthermore, sequential lists are not used by DBMS products to represent trees. Therefore, we describe only linked lists and indexes.Linked-List Representation of Trees.Figure H-18 shows a tree structure in which the VENDOR records are parents and the INVOICE records are children. Figure H-19 shows two occurrences of this structure, and all of the VENDOR and INVOICE records have been written to a direct access file in Figure H-20. VENDOR AA is in relative record number 1 (RRN1), and VENDOR BB is in relative record number 2. The INVOICE records have been stored in subsequent records, as illustrated. Note that these records are not stored in any particular order and that they do not need to be.
การแปล กรุณารอสักครู่..