Question

In: Computer Science

Show that the external path length epl in a 2-tree with m external nodes satisfies epl≤...

Show that the external path length epl in a 2-tree with m external nodes satisfies epl≤ (1/2)(m^2+m−2). Conclude that epl≤ (1/2n)(n+ 3) for a 2-tree with n internal nodes.

Solutions

Expert Solution

Few terms related to given questions are defined as:

  • External node is a node which is different from the rest of the tree.
  • 2-tree is the tree where each node has 2 or more children.
  • EPL stands for External path length. EPL is the sum of lengths of all the paths from root to any external node of a 2 tree. Here, length of path is considered as number of edges.

Now, it is known that m external nodes will have m-1 internal nodes. So, EPL_max is given as:

1 + 2 + - - - - - - - + (m-1) + (m-1)

EPL_max will become

Because sum of n natural numbers is n(n-1)/2.

Therefore, it can be concluded that for m external nodes in a 2 tree,

Now, we know that there are m-1 internal nodes, Lets denote internal nodes as n.

Therefore, n=m-1

                    m=n+1

Now, put m= n+1 in the derived value of EPL_max, we will get,

Therefore, it can be concluded that for a tree with n internal nodes,


Related Solutions

Show that every 2-tree with n internal nodes has n+ 1 external nodes
Show that every 2-tree with n internal nodes has n+ 1 external nodes
Show that if all nodes in a splay tree are accessed in sequential order, then the...
Show that if all nodes in a splay tree are accessed in sequential order, then the total access time is O(N), regardless of the initial tree.
in a decision tree, decision nodes are the nodes in which uncertainty is involved that is...
in a decision tree, decision nodes are the nodes in which uncertainty is involved that is out of the control of the decision maker. do you agree with the statement? explain with examples. projects may vary with the amount of leverage they will support. for example, acquisitions of real estate or capital equipment are often highly levered , whereas investments in intellectual property are not. do you agree with this statement. explain with examples.
A binary tree model with 7 decision nodes will have how many terminal nodes?
A binary tree model with 7 decision nodes will have how many terminal nodes?
Create a kD tree with: x-nodes and y-nodes -- and maintain the following two properties: The...
Create a kD tree with: x-nodes and y-nodes -- and maintain the following two properties: The children of an x-node are y-nodes The children of a y-node are x-nodes Each type of node uses a different comparison to order points. This causes different levels of the tree to compare points differently, using the following rules: For every x-node: All descendants in the left subtree have a smaller x-coordinate than the point stored at the node. Visually, all descendant points are...
Write a solution to return the count of the number of nodes in a binary tree....
Write a solution to return the count of the number of nodes in a binary tree. Your method will be passed one parameter, a copy of a pointer to the root node of the tree (Node *) and will return an int that is the count of nodes. If the tree is empty, return 0 (this is the recursive base case).
Give a proof by induction that the number of nodes of a full binary tree with...
Give a proof by induction that the number of nodes of a full binary tree with a height of "h" is: (2^(h+1))-1.
In the shortest-path algorithm we are concerned with the total length of the path between a...
In the shortest-path algorithm we are concerned with the total length of the path between a source and every other node. Suppose instead that we are concerned with the length of the longest edge between the source and every node. That is, the bottleneck of a path is defined to be the length of the longest edge in the path. Design an efficient algorithm to solve the single source smallest bottleneck problem; i.e. find the paths from a source to...
2. Let BT Node be the class we often use for binary-tree nodes. Write the following...
2. Let BT Node be the class we often use for binary-tree nodes. Write the following recursive methods: (a) numLeaves: a method that takes a BT Node T as parameter and returns the number of leaves in the tree rooted at T. (b) isEven: a boolean method that takes a BT Node T and checks whether its tree is strictly binary: every node in the tree has an even number of children. 3. Suppose you want to improve Merge Sort...
You know now that the 2-4 tree allows 2,3, and 4-nodes that hold more than a...
You know now that the 2-4 tree allows 2,3, and 4-nodes that hold more than a single data element, 'squeezing' the tree to shorter heights, and the B tree is the generalized category of search tree that allows an arbitrary number of data elements in each node. The 2-4 tree is one specific type of B tree. The red black tree is a binary search tree (only one data element per node, the data elements are maintained in order), but...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT