I have some database objects that are fully linked to each other as dependencies. What i want to do is to write an algorithm to retrieve that information and represent all this as a graph. Right now a pseudocode should do the trick for me , then after i should be able to write the python implementation. This seems like a recursive algorithm and this is where i am stuck!
Input (Obj)
list = obj.getDependencies():
if list is empty:
return obj
else
for items in list:
list1 = item.getDependencies()
if list1 is empty:
return item
else:
list2 = item.getDependencies()
......
My mind blows up at this point!!! how can i re-write this algorithm