Is tree structure the right concept?

G

googleo

Hi,

in my application I want to handle and store data in a hierarchic data
structure.
For example: persons who manage houses; houses have various numbers of
floors; floors have various numbers of rooms etc.

My first concept is to use a tree structure, to ideally save the whole
tree to file and load from file.

What do you suggest?
Would the TreeView-Component be appropriate?

Best wiches
googleo
 
J

John Harrison

googleo said:
Hi,

in my application I want to handle and store data in a hierarchic data
structure.
For example: persons who manage houses; houses have various numbers of
floors; floors have various numbers of rooms etc.

My first concept is to use a tree structure, to ideally save the whole
tree to file and load from file.

Well your data is a hierarchy, so a tree structure would seem reasonable.
But when computer people talk about trees they normally have something else
in mind. Namely a tree which can extend to infinite levels and where all the
data is the same type. For instance in a family tree, everyone is a person,
and you can have as many ancestors as you want. You data structure is
different in that you have a fixed number of levels and different data types
at each level. But if you want to call it a tree then that is fine by me.
What do you suggest?
Would the TreeView-Component be appropriate?

I have no idea what a TreeView-Component is, it has nothing to do with C++
(is it some sort of Windows thing, if so ask in a Windows programming
group). Nor has the rest of your question really but if you want to know how
to implement your chosen data structure that would be on topic in this
group.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,474
Latest member
AntoniaDea

Latest Threads

Top