How to check two trees(it may be rooted or unrooted tree(acyclic graph) are isomorphic?

I have stuck in problem of checking two trees(acyclic graph) are isomophic or not
for binary tree, i know how to check… but for tree i found, we have to use hashing for tree but i havnt found any good article regarding it… plz someOne explain how to do it
problem link on hackerRank

i am not able understand from editorial given by hackerRank…
plz help me how to do or any other suggestion
@vijju123

This one is out of my league at the moment :(. Even i couldnt understand the editorial of the problem XD.