×
Log in to StudySoup
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.1 - Problem 13e
Join StudySoup for FREE
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.1 - Problem 13e

Already have an account? Login here
×
Reset your password

# 13E List all the steps used to search for 9 in the

ISBN: 9780073383095 37

## Solution for problem 13E Chapter 3.1

Discrete Mathematics and Its Applications | 7th Edition

• Textbook Solutions
• 2901 Step-by-step solutions solved by professors and subject experts
• Get 24/7 help from StudySoup virtual teaching assistants

Discrete Mathematics and Its Applications | 7th Edition

4 5 1 286 Reviews
30
4
Problem 13E

?13E List all the steps used to search for 9 in the sequence 1, 3, 4, 5, 6, 8, 9, 11 using a) a linear search. b) a binary search.

Step-by-Step Solution:
Step 1 of 3

Solution: Step1 To find Show all the steps used to search for 9 in sequence 1, 3, 4, 5, 6, 8, 9, 11 using a) a linear search. b) a binary search. Step2 We have The sequence 1, 3, 4, 5, 6, 8, 9, 11. Linear search is a method for searching a objective value within a list. It sequentially checks each element of the list for the objective value until a match is found or until all the elements have been searched. Binary search is used to quickly find a value in a sorted sequence . a. a linear search. Let n be the total number in the sequence So, n=8 And j is the index of the sequence When j=1 In this index element is 1 So,1 =/ 9 When j=2 In this index element is 3 So,3 =/ 9 When j=3 In this index element is 4 So,4 =/ 9 When j=4 In this index element is 5 So,5 =/ 9 When j=5 In this index element is 6 So,6 =/ 9 When j=6 In this index element is 8 So,8 =/ 9 When j=7 In this index element is 9 So,9 = 9 Now no more search is required because found element 9 at j=7. Step3 b. a binary search By starting with 1, 3, 4, 5, 6, 8, 9, 11 (k = 1, n= 8, t = 4) Compare the t-th element in the list with 9. For this case t= 4, so compare 9 with 5. Because 5 < 9, take the second half 6, 8, 9, 11 (k = 5, n = 8, t= 6) Compare the t-th element in the list with 9. For this case t= 6, so compare 9 with 8. Because 8 < 9, take the second half 9, 11 (k = 7, n = 8, t = 7) Compare the t-th element in the list with 9. For this case t = 7, so compare 9 with 9. because 9 is not less than 9, take the first half by setting n = 7(= t). Because 9 = 9, the algorithms returns k, which is 7.

Step 2 of 3

Step 3 of 3

##### ISBN: 9780073383095

Since the solution to 13E from 3.1 chapter was answered, more than 440 students have viewed the full step-by-step answer. Discrete Mathematics and Its Applications was written by and is associated to the ISBN: 9780073383095. The full step-by-step solution to problem: 13E from chapter: 3.1 was answered by , our top Math solution expert on 06/21/17, 07:45AM. This textbook survival guide was created for the textbook: Discrete Mathematics and Its Applications, edition: 7. The answer to “?13E List all the steps used to search for 9 in the sequence 1, 3, 4, 5, 6, 8, 9, 11 using a) a linear search. b) a binary search.” is broken down into a number of easy to follow steps, and 30 words. This full solution covers the following key subjects: search, sequence, list, Binary, Linear. This expansive textbook survival guide covers 101 chapters, and 4221 solutions.

#### Related chapters

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

13E List all the steps used to search for 9 in the