A ternary heap is a generalization of binary heaps, but in which most nodes have three child nodes. Like a binary heap, a ternary heap is a complete tree (all levels except the last are full, and all...

A ternary heap is a generalization of binary heaps, but in which most nodes have three child nodes. Like a binary heap, a ternary heap is a complete tree (all levels except the last are full, and all leaves occupy the minimal "left-most" positions in the tree). Assume that you will implement the ternary heap as an in-place array of n nodes with the root at index 0.
A. Find a mathematical function, p(i), that, for any child node index i, provides the index of its parent node; assume p(0) = 0.
B. Use induction to prove your function is correct for all possible ternary heaps.
Apr 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here