there undirecte tree n vertex connect n1 bidirectional edge there snake stick inside tree its head vertex tail vertex b the snake body occupy vertex unique simple path bthe snake want know reverse head tail start tail head start unfortunately snake movement restrict tree structureIn operation snake head adjacent vertex currently occupy snake when tail move vertex close head length snake remain unchanged similarly snake tail adjacent vertex currently occupy snake when head move unit close tail Lets denote snake position ht h index vertex snake head t index vertex snake tail this snake reverse movement 47to 51to 42to 1 3to 72to 81to 74 Determine possible reverse snake sequence operation