Solved

A Ternary Tree Is Like a Binary Tree,except Each Node

Question 38

Essay

A ternary tree is like a binary tree,except each node may have up to three successors.Write a TNode class that can be used to represent a ternary tree.Define a notion of preorder and postorder traversal for ternary trees,and write methods void postorder(TNode tree)and void preorder(TNode tree)that implements your notion of those traversals.

Correct Answer:

verifed

Verified

class TNode
{
TNode left,middle,right;
S...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions