Euler tour of tree has been already discussed which flattens the hierarchical structure of tree into array which contains exactly 2*N-1 values. In this post, the task is to prove that the degree of Euler Tour Tree is 2 times the number of nodes minus one. Here degree means the total number of nodes get traversed in Euler Tour.
Using Example 1:
It can be seen that each node’s count in Euler Tour is exactly equal to the out-degree of node plus 1.
Mathematically, it can be represented as:
Total represents total number of nodes in Euler Tour Tree
represents ith node in given Tree
N represents the total number of node in given Tree
represents number of child of
Calculated Answer is 15 and is Equal to Actual Answer Calculated Answer is 17 and is Equal to Actual Answer
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Euler Tour of Tree
- Euler Tour | Subtree Sum using Segment Tree
- Euler tour of Binary Tree
- The Knight's tour problem | Backtracking-1
- Minimum steps to come back to starting point in a circular tour
- Total ways of choosing X men and Y women from a total of M men and W women
- Count the nodes of the tree which make a pangram when concatenated with the sub-tree nodes
- Euler's Totient Function
- Euler's Totient function for all numbers smaller than or equal to n
- Euler's criterion (Check if square root under modulo p exists)
- Optimized Euler Totient Function for Multiple Evaluations
- Euler Method for solving differential equation
- Euler's Four Square Identity
- Euclid Euler Theorem
- Predictor-Corrector or Modified-Euler method for solving Differential equation
- Count integers in a range which are divisible by their euler totient value
- Euler zigzag numbers ( Alternating Permutation )
- Check if a number is Euler Pseudoprime
- Euler's Factorization method
- Count of elements having Euler's Totient value one less than itself
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.