• Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie Question on dependency execution  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm completely new to java. I'm trying the tackle this following scenario. For e.g. I've a list of “Tasks” and their dependencies. E.g. Task D depends on (Task A and Task B) , Task A depends on Task B, Task B depends on Task C.
I'm trying to write a program to print out the sequence of these tasks (For example, using the case above, it should be C, B, A, D).
1. What is the best way to approach this ?
2. What possible ways I can test this design?
3. How can I make sure that there's no circular dependency?
Any pointers will be highly appreciated.
-Thanks
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Acyclic digraphs, cycle detection.
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan Shah, welcome to the Ranch

David Newton, remember this is "beginning Java"; please explain a bit more so the rest of us can understand the solution
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't seem like a Java question, more of an algorithmic one--those are the search times I'd use to find the research.
 
Campbell Ritchie
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right it is a not a language-specific question.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!