In the question , it is said that we need to print the answer to the query of type 2, should answer be the distances??? and also there is only one occurence od type 2 query, how are there 3 answers ?
Confusion in quesiton understanding- Mike and OR tree
Hi @Yukti-Gos-2209938979084017
You need to print answers for query type 1 ie calculating distances. The language in the question will be rectified.
Rest of the question remains the same. There is no cost of traversing till the nodes that have value=1.
So initially cost of Reaching Node_5 was 3 (1->2->4->5). After updating Value for Node_2, the cost for Reaching Node_5 becomes 2 (2->4->5).
I hope this helps you understand the question.
Please mark the thread resolved is so
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.