Page 1 of 1

6. (a) (8%) Draw a decision tree that describes binary-search when it is applied to search for a number X in a sorted ar

Posted: Sun May 15, 2022 12:12 pm
by answerhappygod
6 A 8 Draw A Decision Tree That Describes Binary Search When It Is Applied To Search For A Number X In A Sorted Ar 1
6 A 8 Draw A Decision Tree That Describes Binary Search When It Is Applied To Search For A Number X In A Sorted Ar 1 (21.41 KiB) Viewed 57 times
6. (a) (8%) Draw a decision tree that describes binary-search when it is applied to search for a number X in a sorted array A[1..4] of four distinct numbers. (Note: there are three possible outcomes of a comparison between two values X and Y, namely, "X<Y", "X = Y", and "X >Y".) (b) (6%) Determine the average number of comparisons binary-search takes on an array of four distinct elements. (Note: this question is meant to be vague. State any assumptions you made.)