Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT edges = [ [ 1 , 0 ] , [ 0 , 3 ] , [ 0 , 8 ] , [ 2 , 3 ] , [ 3 , 5 ] , [ 3 , 6 ] , [ 3 , 7 ] , [ 4 , 5 ] , [ 5 , 9 ] ] NEW_LINE V = len ( edges ) NEW_LINE marked = [ 1 , 2 , 4 ] NEW_LINE N = len ( marked ) NEW_LINE K = 3 NEW_LINE print ( nodesKDistanceFromMarked ( edges , V , marked , N , K ) ) NEW_LINE DEDENT