Question

. [25 pts.] Tree node with largest value children. Consider a complete ternary tree where each...

. [25 pts.] Tree node with largest value children. Consider a complete ternary tree where each node apart from the leaves has exactly 3 children and is associated with a numeric key k.

a [15 pts.] Write the pseudo-code of a procedure that returns the node whose children have the largest sum of keys, i.e. the score of a node is the sum of its children key values. Note that leaves would not be considered as they do not have children.

b [10 pts.] What is the asymptotic running time O() of the algorithm for a tree of n nodes? Show your derivation.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Do like and comment if you have any queries.

Answer:

Add a comment
Know the answer?
Add Answer to:
. [25 pts.] Tree node with largest value children. Consider a complete ternary tree where each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The first and second picture are the definition of 2-3 tree,3rd and 4th are the pre-condition...

    The first and second picture are the definition of 2-3 tree,3rd and 4th are the pre-condition and post-condition. Please use these question to solve problem 8,the last photo. 2-3 Trees: Definition Suppose that E is an ordered type, that is, a nonempty set of values that have a total order. A 2-3-tree, for type E, is a finite rooted tree T (like a binary search tree or a red-black tree) that satisfies the following 2-3 Tree Properties: (a) Every leaf...

  • I need help in C++ implementing binary search tree. I have the .h file for the...

    I need help in C++ implementing binary search tree. I have the .h file for the binary search tree class. I have 4 classic texts, and 2 different dictionaries. Classic Texts: Alice In Wonderland.txt A Tale of Two Cities.txt Pride And Prejudice.txt War and Peace.txt 2 different dictionaries: Dictionary.txt Dictionary-brit.txt The data structures from the standard template library can not be used.The main program should open the text file, read in the words, remove the punctuation and change all the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT