230k views
4 votes
What is the advantage of utilizing trees as a data structure? Describe a scenario where you may use either a linear data structure or a tree and show which would be more effective and why?

1 Answer

4 votes

Answer:

The tree data structure provides more flexibility and practicality.

Step-by-step explanation:

The tree data structure is more advantageous because of it's practicality in terms of forming relationships within the data.

A tree data structure would be preferable for an e-commerce website or database because it provides the ability to be able to links different products and group them under sub categories etc. Basically it makes a more reliable database in this situation.

I hope this answer helps.

User Hazzit
by
4.1k points