Question - How to differentiate between “wanted” and “unwanted branch” ?
Answer -
When we derive a word in Top down parsing beginning with the starting Non Terminal the branches of the tree that do not lead to our required word are left aside these branches are called unwanted branches.
For example for CFG
S—–>AA
A—–>a | b
If we want to generate the word “aa” we will leave the branch generated by the production A——>b.