2 1 3 1 4 3 5 2 6 1 7 2 8 6 9 8 10 8 On removing edges (1,3) and (1,6), we can get the desired result 2.
()
| 31 | |
| 32 | |
| 33 | def even_tree(): |
| 34 | """ |
| 35 | 2 1 |
| 36 | 3 1 |
| 37 | 4 3 |
| 38 | 5 2 |
| 39 | 6 1 |
| 40 | 7 2 |
| 41 | 8 6 |
| 42 | 9 8 |
| 43 | 10 8 |
| 44 | On removing edges (1,3) and (1,6), we can get the desired result 2. |
| 45 | """ |
| 46 | dfs(1) |
| 47 | |
| 48 | |
| 49 | if __name__ == "__main__": |