aaaa12345
WLOG let root is of type $1$.Let $f(k)$ denote number of nodes with type $1$ in level k and $g(k)$ be number of nodes of type other than $1$. So, in level zero(root) there is only one node of type $1$ and zero nodes of other types. So, $f(0) = 1$ and $g(0) = 0$.Now, $1$ can be the child of only $2$ and $3$. So, number of $1$'s at level $k1$ is equal to number of $2$'s and $3$'s at level $k$. So, $f(k1) = g(k)$. And number of $2$'s and $3$'s at level $k$ is number of nodes in level $k$ - number of nodes of type $1$. So, $g(k) = 2^k - f(k)$. So, $$f(k1) = 2^k - f(k)$$ $$f(k1) f(k) = 2^k$$So, total number of nodes of type $1$ in a tree of height $n$ is equal to $$f(0) f(1) ...... f(n)$$ $$= (f(n) f(n-1)) (f(n-2) f(n-3)) .....$$ $$= 2^n-1 2^n-3 .....$$And it is equal to $dfrac2^n1 - 13$ when n is odd and $dfrac2^n1 13$ when n is even.
1. What kind of tree is this?
It appears to be an apple tree.We have one here at out house and there is one at my neighbor's house
2. Any help with a fig tree?
Its probably just taking a nap. Young trees (figs 'specially) like to sleep alot. Has it been hot and dry for you? You do not mention location/zone. Just keep it well watered, NOT overwatered, and a little light fertilizer. It should bounch back well in the spring, if it does not do a little growing in the fall.
3. which tree having no wood?
....lycopods also, perennial plants, that die-back each winter and regrow in spring are non-woody trees, as herbaceous plants such as rosemary, peony and hostas ....perennials survive several growing seasons ...woody roots of some perennials sustain their lives much longer ...one may cite grassy plants alongside non-woody trees in fact, as grass reestablishes itself along a root system which thrives year to year as in bermuda or prairie grasses ....berry plants, such as raspberries develope biennial canes and regrow new limbs each year ...roses are tree-like, more closely resembling wood, yet not the same, rose plants have no wood ...Hollywood? ...the family tree?
4. What is correct "bird in a tree" or "bird on a tree"? Please link to the source.?
bird in a tree Preposition Use - in / at / on - prepositions of place IN Use 'in' with spaces: in a room / in a building in a garden / in a park Use 'in' with bodies of water: in the water in the sea in a river Use 'in' with lines: in a row / in a line in a queue AT Use 'at' with places: at the bus-stop at the door at the cinema at the end of the street Use 'at' with places on a page: at the top of the page at the bottom of the page Use 'at' in groups of people: at the back of the class at the front of the class ON Use 'on' with surfaces: on the ceiling / on the wall / on the floor on the table Use 'on' with small islands: I stayed on Maui. Use 'on' with directions: on the left on the right straight on IMPORTANT NOTES In / at / on the corner We say 'in the corner of a room', but 'at the corner (or 'on the corner') of a street' In / at / on the front We say 'in the front / in the back' of a car We say 'at the front / at the back' of buildings / groups of people We say 'on the front / on the back' of a piece of paper
5. if you shake a tree?
Which nuts are you talking about? lmao
6. Check if Binary Search Tree
You forgot to check the result of your recursing calls. Your steps are fine, if you meant the following in step 7Step 7: recurse and check resultHowever, even then, it's not the correct property of a binary search tree. Have a look at the following tree:Does this hold for your steps? Yes. Does this hold for your algorithm, if you check the result of checkBST?Yes. But is it a binary search tree? No. You would never find 6. All nodes left of the root must be smaller, and all nodes right of the root must be greater.Remember, a binary tree has the following property: if you want to find a value, you look at the current value. If the value you are looking for is smaller, you continue in the left tree. If the value is greater, you continue in the right tree. But you always look at one of those subtrees. Never both. In a balanced binary tree, you would only have to look at $log_2(N)$ nodes to find your value.I would link you to the Wikipedia section on Verification, but it already holds the solution. But here is a hint: carry along what numbers are allowed in your subtree. So, to go back to your steps, you should do something like this:The steps 0 and 1.5 are missing. They handle the current value and the range of valid values. Coming up with them will be the crucial part. By the way, you usually do not use parent in a binary tree. But that depends on your use-case. Also, you have memory leaks. For small examples, there is no harm not using malloc: