Logic or Algorithm to solve this problem [closed]
- by jade
I have two lists.
List1 {a,b,c,d,e}
and
List2 {f,g,h,i,j}
The relation between the two list is as follows
a->g,a->h,h->c,h->d,d->i,d->j
Now I have these two lists displayed. Based on the relation above on selecting element a from List1, List2 shows g,h. On selecting h from List2, in List1 c,d are shown in List1. On selecting d from List1 it shows i,j in List2.
How to trace back to initial state by deselecting the elements in reverse order in which they have been selected?