The presence of a tree (logical in the database) with elements in the form
- List Item A
- List of items B
- List item C
- List item D
- List Element E
- List item F
- List of G Elements
and so on (the depth of nesting is not limited), I want to get the next node down (or up), starting from an arbitrary node.
Let's say List Item D is given. I want to write a GetNextNode() function that returns List Item E
My idea would be to do some recursions, but maybe there is a smarter way to handle this?
My question is:
How would you solve this?
EDIT 1:
The tree can be obtained using functions such as:
GetParentNode()GetChildrenNodes()GetNextSiblingNode()- etc.
Thus, it is similar, for example, to e Windows Forms TreeView .
source share