How can you understand the tree better?

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.