Assignment1Questions.pdf -...

This preview shows page 1 out of 2 pages.

9/13/2016 webhome.cs.uvic.ca/~ruskey/classes/226/Ass1_226Summer2016.html 1/2 Assignment #1: Programming Part We discussed in class the "natural correspondence" between binary trees and ordered forests. We can also represent binary trees (and hence ordered forests) as binary strings. The binary string is obtained by traversing a binary tree in preorder, recording a 1 for every node and a 0 for every empty subtree (null link). In this assignment you will write a program that takes as input a binary string representing the binary tree representation of an ordered forest and produces the binary string that represents the binary tree that represents the ordered forest that one obtains by looking at the forest in a vertically aligned mirror. Hence we will call it the mirror of the ordered forest. In the example below the original forest is on the left and the mirrored forest is on the right; the input string is 1101100011000, and the output string is 1100111001000.
Image of page 1
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern