Question: Description:(PYTHON) Consider a tree constructed with following procedure: Define 2 nodes with values 0/1 (the left side) and 1/0 (the right side). Add the 2

 Description:(PYTHON) Consider a tree constructed with following procedure: Define 2 nodes

with values 0/1 (the left side) and 1/0 (the right side). Add

Description:(PYTHON) Consider a tree constructed with following procedure: Define 2 nodes with values 0/1 (the left side) and 1/0 (the right side). Add the 2 node's numerator and denominator respectively, and we gained node with value 1/1. This is the root node of our tree. Between every 2 adjacent nodes, we insert a new node with value being the 2 nodes' numerator and denominator added respectively. The new node is inserted at the middle-bottom of the 2 nodes. By repeating step (3), Our tree grows downwardly. Actually, such tree has following properties: 0 1 1. This is an infinite binary tree. 3.The tree contains all possible non-negative fractions and each exactly once Input: 2 integers (both positive) M,N that represent M/N Output: A single string thatshows how to achieve the node with value being its irreducible form from root. Return nothing (empty string) if there is no route needed. Sample Input: 57 Sample Output: LRRL

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!