How to implement a dependency tree or similar for resource dependencies?

Grevanius

New Member
With out libraries, I'm trying to learn data structures.I have these dependencies\[code\]jquery.js->jqueryui.js(underscores.js, jquery.js) -> backbone.js\[/code\]Bascially, jqueryui depends upon jquery. Bacbkone depends on both underscore and jquery. Jquery and underscore are not related.I want to create a dependency tree have you to "shed light" on these relations.I was told this is how it is done on this posted question. Particularly this comment.\[quote\] As long as you don't have a circular dependency you can always build a dependency forest, which consists only of directed trees and/or sole nodes. On the trees you can simply use DFS. You then start by adding all roots or single nodes into a queue and add other resources to the queue when their dependency has been loaded. (note that if a resource has several dependencies you cannot model your dependencies as a forest, but it stays acyclic and you can use a similar approach).
 
Top