P
P
Praytic2015-09-27 03:10:14
Algorithms
Praytic, 2015-09-27 03:10:14

How to implement folder hierarchy?

You need to implement an algorithm that allows you to move through the folder hierarchy, like this:
581297ccc102caf338deb3b2b527bf47.png
Here, an open folder shows its subfolders, but closed ones do not. Actually this is the question. What is the way to implement it? With some graph? And how then to move the cursor of the current folder along this graph?
PS. Arrows up and down - only the transition to neighboring folders. Arrows to the right and left - move down and up the hierarchy, respectively.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EndUser, 2015-09-27
@EndUser

This is a slightly imprecise question.
Judging by the "algorithms" section, the answer should be "the folder graph is essentially a tree, and tree traversal algorithms must be applied." Then the word "cursor" is inappropriate.
If the word "cursor" is necessary, then it is not clear what computer systems, what interfaces, what tools you use to understand which instrumental question you are asking exactly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question