java - Best sorting and formatting algorithm for flat data to directed graph tree -



java - Best sorting and formatting algorithm for flat data to directed graph tree -

given flat info this:

01001, butter, salted 01002, butter, whipped, salt 01145, butter, without salt 04601, butter, light, stick, salt 04602, butter, light, stick, without salt

what's best approach convert this:

butter (01001, 01002, 01145, 04601, 04602) -> salted (01001) -> whipped (01002) -> salt (01002) -> without salt (01145) -> lite (04601, 04602) -> stick (04601, 04602) -> salt (04601) -> without salt (04602)

i thinking of recursive sorting first, realized there may lot of string comparisons efficient.

java algorithm parsing graph tree-traversal

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -