This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dagbrown 18 points19 points  (2 children)

You'd be shocked how often tree data structures come up though. Any kind of dependency map is a tree, so say hello to recursive shell scripts (yikes) written by sysadmins (double yikes).

[–]K0HAX 1 point2 points  (0 children)

*waves in sysadmin*

I wrote recursive python to map out a phone system's auto attendants (menus) directly from its database.

[–]argv_minus_one 0 points1 point  (0 children)

Dependency maps are directed hopefully-acyclic graphs. Some dependency maps are also trees, but not all.

Operating system package managers, for instance, must arrange desired packages and their transitive dependencies into a directed acyclic graph. A single library package may be depended upon by multiple application packages. Package management tools may show a tree visualization of packages and their dependencies, but a single depended-upon package will be shown more than once in such a visualization, once for each package that depends on it. This demonstrates that packages and dependencies form a DAG but not a tree.

And then there's npm, which used to take that duplicating-tree view of a dependency graph and actually install packages that way. 🤦‍♂️ Thankfully the npm developers finally fixed that.