Can someone help me further with this?

https://ide.codingblocks.com/s/232403 Tried out this much. Cant figure out what to do next

@tusharnitharwal
your dfs and insert are not correct
i have corrected your code refer to this

The code worked fine. Thanks!! and also what would be the issue if i use m[s[i]]=new node and m.insert()