Click here to Skip to main content
15,913,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got a database table from a server.For example,the table named DepartmentInformation.There saved some department name and sub-department name and sub-sub-sub-department name(like this) in it.Taking an example,"00" stands for the highest class department name,and "01" , "02" ... (like that) are the sub-department of "00", continuing, "0101" is the sub-department name of "01" ,"010101" is the sub-item of "0101" ... (the sub-item's length is longer than its parent's node name,but the header sub-string of sub-item is the same as the parent's) ... they were saved in a mutual table.

But I am afraid that it slow down the speed because of the much amount of data(around 80 thousands).


So what kind of proper algorithm can I take a try? Thanks for answering!

What I have tried:

I use the map data structure to save the table data from the database.I am ready to take the recursion way to extract the parent-item and child-item.First of all,I am going to find the root item in the map by using the recursion algorithm.And then find the sub-item of the root item,like this ...
Posted
Updated 15-Feb-17 21:45pm
v2

1 solution

I already explained the issue in your previous question: How to represent a tree according to some relational tables which uses the MFC tree control[^]. If you want to process 80,000 records all at the same time then your application will be very slow.
 
Share this answer
 
Comments
Mark Danniel 16-Feb-17 19:54pm    
Thank you very much. I'll have a try.

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