A tree-shaped catalog is needed in the project and is always understandable. How to more intuitive understanding of him AH ~!
Reply to discussion (solution)
Why is it called intuition?
Http://bbs.csdn.net's sidebar, isn't that intuitive?
Don't you understand the principle?
Why is it called intuition?
ID Name Sysno
1 small Black 0
2 small white 1
3 Little Red 2
4 Floret 2
5 Little Blue 1
6 Small Yellow 0
What is the shape of the tree? One example would be the most intuitive.
Don't you understand the principle?
Oh, yes.
Http://bbs.csdn.net's sidebar, isn't that intuitive?
Yes, yes.
But, how to say it. Those that correspond specifically, do not understand.
For example, after the pull down, how to judge what can continue to pull down, which can not do it ~
1 small Black 0
-2 small white 1
--3 Little Red 2
--4 Floret 2
-5 Little Blue 1
6 Small Yellow 0
1 small Black 0
-2 small white 1
--3 Little Red 2
--4 Floret 2
-5 Little Blue 1
6 Small Yellow 0
A little bit abstract ~ ~ ~
Which is the most superior, those are similar ah?
1 small Black 0
-2 small white 1
--3 Little Red 2
--4 Floret 2
-5 Little Blue 1
6 Small Yellow 0
A little bit abstract ~ ~ ~
Which is the most superior, those are similar ah?
In the third column, 0,1,2 is the corresponding level.
When designing a database, you can use a field to place a hierarchy ID, and then use a field to place a level ID
1 small Black 0
-2 small white 1
--3 Little Red 2
--4 Floret 2
-5 Little Blue 1
6 Small Yellow 0
A little bit abstract ~ ~ ~
Which is the most superior, those are similar ah?
In the third column, 0,1,2 is the corresponding level.
When designing a database, you can use a field to place a hierarchy ID, and then use a field to place a level ID
1
-2
--3
6
-5
--4
Is that the case?
When the data is generated, who is the subordinate, the one you specify
And when you save it, you leave an anchor point based on the preset algorithm.
Like you #4 example is the data structure of the adjacency list algorithm