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
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
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
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.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!