Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Greetings ,

For my application I need to make AVL trees for tags that would be balanced with every query. What would be a good a database to store this form of data. XML is taking way too much time to store and parse?

It is a .NET based project and any help would be appreciated.
Posted
Updated 19-Apr-19 9:31am
Comments
Sergey Alexandrovich Kryukov 13-Feb-15 10:36am    
How to interpret such question as "What would be a good a database..?" Do you expect a database in reply? :-)
Relational model allows you to store any arbitrary data graph, so why not a tree?
—SA

Please see my comment to the question. In simplest case, if you have some graph (not only a tree) with the nodes of the same type, it can be represented by a single table, a table of nodes. Each record should have one or more attribute used to indicate relation with other node pointing to it by its primary key. (For AVL, such attributes could be left and right.) Such relations represent graph edges.

Please see:
http://en.wikipedia.org/wiki/Relational_model[^],
http://en.wikipedia.org/wiki/AVL_tree[^],
http://en.wikipedia.org/wiki/Graph[^].

—SA
 
Share this answer
 
I think this would be a good read on how to store AVL trees in SQL Server.

Binary Trees in SQL - Simple Talk[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900