Question: recursively define general binary trees. A node can now have 0 , 1 or 2 children. These may not be balanced and all the leaves

recursively define general binary trees. A node can now have 0,1 or 2 children. These may not be balanced and all the leaves may not be on the same level of the tree. This definition can also capture full binary trees. This is a tricky definition and you can make-up some notation or have cases by using logical AND or OR in your definition.
An example that recursively defines a set of binary strings ({0,1,00,01,10,11,000,001,010,011,100,...}) might look like
B(1)=0 OR B(1)=1(now there are 2 base cases)B(n)= B(n-1)0 OR B(n-1)1(now there are 2 rules and I claim that the symbols B(n-1)0 and B(n-1)1 are concatenated together. So one adds a 0 to the end of a binary string B(n-1) and the other adds a 1. Your recursive tree definition will be different, this is just an example of having different cases, and it also uses string concatenation. You can be a bit creative.

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!