Questions from textbook <Essential Algorithms And Data Structures >

Hello all,

Textbook question on Page 74 - EssentialAlgorithmsAndDataStructures_FirstEdition

After removing simplify tree component ( highlight part), the definition does not work. I was wondering any special function of simplify tree component here. Thank you.

The path is just from {0;0;0} to {0}. why we have to do this step ?

If you don’t simplify output P the mask {+1}[+1] isn’t appropriate anymore, and thus doesn’t work. The first segment of the mask {+1} describes that you want to shift paths {x} (or {0}) by 1. If you pass it {0;0;0}, you need to change the mask accordingly to something like {0;0;+1} or similar depending on your tree structure.

1 Like

Here’s a simpler example:

Thank you, Diff-arch. I got it. :smiley: It sounds like a small “trick” I ignored.