Patent ID: 7627604

Claim:
A method of converting an expression form of a tree data structure represented by using parent-child relationship on a storage device, the parent-child relationship being defined by storing numbers assigned to parent nodes in the storage device in the order of numbers assigned to child nodes corresponding to the respective parent nodes, the method comprising the steps of: calculating a generation number for each node in the tree data structure expressed in a depth-first mode for assigning numbers to nodes in the same generation as a certain node earlier than child nodes of the certain node, and a count of nodes belonging to each generation; determining numbers assigned to nodes in each generation on the basis of the count of the nodes belonging to each generation when the numbers are assigned in a width-first mode for assigning numbers to child nodes of a certain node earlier than nodes in the same generation as the certain node; creating a conversion array for converting the numbers assigned to the respective nodes in the depth-first mode to numbers to be assigned to the nodes in the width-first mode on the basis of the calculated generation number for each node and the determined numbers assigned to the nodes in each generation; and converting the parent-child relationship for each node to another parent-child relationship expressed by the numbers assigned to the nodes in the width-first mode by using the conversion array.