Question: part 3 : Write a recursive function that given a sorted tree, returns a list of numbers in ascending order. The instruction for part 3

part 3: Write a recursive function that given a sorted tree, returns a list of numbers in ascending order. The instruction for part 3is:
Part 3: Write a recursive function tree-to-list that given a sorted tree, constructs the list of numbers in order.
Test your function with:
(tree-to-list (list-to-tree '(22257168346773217845319)()))
list-to-tree should work as defined in the previous 2(part 1and part 2)
This should return '(34577881617192225323467)
Tree-to-list should not call flatten or any sorting function.

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 Programming Questions!