Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjstehno/depgraph
Dependency graph excersize
https://github.com/cjstehno/depgraph
Last synced: about 5 hours ago
JSON representation
Dependency graph excersize
- Host: GitHub
- URL: https://github.com/cjstehno/depgraph
- Owner: cjstehno
- Created: 2015-07-04T16:15:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-04T16:16:39.000Z (over 9 years ago)
- Last Synced: 2023-03-11T10:41:26.498Z (over 1 year ago)
- Language: Groovy
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dependency Graph Exercise
## Instructions
Problem: Given a dependency graph, print a hierarchical view of the dependencies.
Data: The graph is in the attached graph.txt file. The data is provided in the form "X->Y", stating that X depends on Y.
Assignment: Walk the dependency graph, starting at A, printing out each dependency. Repeat for each dependency visited, indenting along the way. E.g.
If A depends on B and C, and B depends on C and D the output should look like this:A
|_ B
| |_ C
| \_ D
|_ CImplement in any JVM-based language of your choice.
## Usage
You can run the application from Gradle:
./gradlew -Pfile= run
A summary of the dependency tree will be generated to System.out similar to the following:
<+>
|_ A
|_ B
| |_ C
| |_ B (*)
|_ D
-------------------------------------------
(* represents cyclic dependency truncation)> Note that the output format was changed slightly to accommodate the possibility of multiple top-level dependencies.