Hi.
I have an HashMap<
String,String> childParentMap which looks like below
Child (key) Parent (value)
B A
C B
D C
E A
F E
G F
H B
I H
I need to pass a parent & find the entire hierarchy.
say if i pass A - then i should get
A->B->C->D
A->B->H->I
A->E->F->G
and if i pass B then i should get
B->C->D
B->H->I
Since there can be duplicates present in the parent value of HashMap I am facing difficulty in computing the hierarchy. Any advise please!