+ 1

About Tree and recursive and i do not totally understand that. Can someone explain it for me, please ???

public int count(Object n) { int count = 1; // includes n if (edges != null) { Object[] e; for (Object eobj : edges) { e = (Object[]) eobj;// i do not understand this code if (e[0] == n) { count += count(e[1]); } } } return count; }

13th May 2019, 3:29 AM
Ha Nguyen
Ha Nguyen - avatar
1 Resposta
+ 1
Check out link https://en.m.wikipedia.org/wiki/Recursion_(computer_science)
18th May 2019, 12:20 AM
Da2
Da2 - avatar