Purchase Solution

converting ternary to binary

Not what you're looking for?

Ask Custom Question

Write the pseudocode for a recursive function TERNARY TO BINARY, that will convert a ternary tree into a binary search tree.

Purchase this Solution

Solution Summary

The expert writes pseudocodes for a recursive function. The expert converts a ternary tree into a binary search tree.

Solution Preview

I recommend reading the attached file; it's the same as below but with nicer formatting :-)


Your problem is to write a psuedocode algorithm which will take in a ternary search tree and convert it into a binary search tree.

Recall that a ternary search tree is just a binary search tree where each node has an extra child. I will assume for this problem that in your binary search tree, a matching node becomes the right child; you can easily modify the algorithm if your teacher prefers it to be the left child.

Let's start with just the most basic psuedocode:

set binary_node_1 = ternary_node_1

Purchase this Solution

Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C++ Operators

This quiz tests a student's knowledge about C++ operators.