Наличие дерева ( логический в БД) с элементами в форме
- Элемент списка A
- Элемент списка B
- Элемент списка C
- Элемент списка D
- Элемент списка E
- Элемент списка F
- List Item G
and so on (nesting depth 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 function GetNextNode()
that would return List Item E
.
My idea would be to do some recursion stuff, but maybe there is a more clever way to handle this?
My question:
How would you solve this?
EDIT 1:
The tree can be accessed with functions like:
GetParentNode()
GetChildrenNodes()
GetNextSiblingNode()
So it's similar to e.g. e Windows Forms TreeView
.