How is this decision tree constructed?

1 reply · 2K views · last reply
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

In my notes there is the following decision tree:

View attachment 3838

Could you explain me how it is constructed? (Thinking)
 
Attachments
  • Binary decision tree for sorting three elements a_1, a_2, a_3. Internal nodes compare pairs such as a_1 ? a_2 and a_2 ? a_3; red leaves list permutations like a_1,a_2,a_3 and a_3,a_2,a_1.
    decision.png
    6.5 KB · Views: 129
It shows you which comparisons need to be made in order to sort $a_1,a_2,a_3$, as well as the result of the sorting in each case.