Question: Coding Question Problem Statement Let us consider a full binary tree. The root is labelled 1 . For every node labelled s, its left child

 Coding Question Problem Statement Let us consider a full binary tree.

The root is labelled 1 . For every node labelled s, its

left child will be labelled 2 s and its right child will

Coding Question Problem Statement Let us consider a full binary tree. The root is labelled 1 . For every node labelled s, its left child will be labelled 2 s and its right child will be labelled 2s+7 You are given a space, separated input of the form i j. Print the length of the shortest path between node labelled i and node labelled j. Input: First line contains N, the number of queries. Each query consists of two space separated integers i and j in one line. Output : For each query, print the required answer in one line. Note: The Length of the path will always be positive. Example 1: Input: 12 Output: 1 Example 2: Input: 314 Output : 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!