F
F
Fortunato282018-09-11 15:32:36
C++ / C#
Fortunato28, 2018-09-11 15:32:36

Is it better to represent the nodes of a tree structure as instances of a class or structure?

Actually, the question is higher. I know the differences between classes and structures, but maybe there is some logic, what is the best way to describe tree nodes, an instance of a structure or class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex_fedorov, 2018-09-11
@alex_fedorov

In C++, there is exactly one difference between a class and a struct: data in a struct is public by default, while data in a class is private. So there is no fundamental difference (from my point of view)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question