Question: Question 1: Question 2: Page 171 for question 2: Please answer both question 1 and 2. Thank you! points Basic. Decision tree for Selection-SOr Selection-Sort
Question 1:

Question 2:

Page 171 for question 2:

Please answer both question 1 and 2. Thank you!
points Basic. Decision tree for Selection-SOr Selection-Sort (A) n A. length. For j 1 to n 1 Do smallest j For i j 1 to n Do if Ali A CsmallestJ Then smallest i Exchange A with A [smallest (a) (6 points) Draw the decision tree corresponding to Selection-Sort when running on an array of n 3 elements A a1, a2, a3 as in fig. 8.1 (keep "S" on the left child and on the right child). (b) (2 points) Mark the execution path followed for the array A 6,4,2), as in fig. 8.1. (c) (2 points) For the tree you drew, how many leaves does it have Compare this with n and comment on the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
