2010 Programming Assignment 2

2010 Programming Assignment 2 - Input: The input file,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment 2 (10%) Due Date: October 11 Fall, 2011 Write a program to construct a Binary Tree from the list of words. From your input file, the first word is root of your binary tree. * The left subtree of a node contains only nodes with keys less than the node's key. * The right subtree of a node contains only nodes with keys greater than the node's key. * Both the left and right subtrees must also be binary trees. In your binary tree, the sorting is to be done alphabetically!!
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Input: The input file, called the p2_input.txt , which contains the list of words with their length. Your input file always ends with 0. For example, When you submit your PA2, you dont need to submit input file. Your grader will use other input file in the same format! Output: Print yout binary tree as follows; print ( position_num : word) for each level. Other Example: Input file: Output:...
View Full Document

Page1 / 2

2010 Programming Assignment 2 - Input: The input file,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online