EBK BUILDING JAVA PROGRAMS
4th Edition
ISBN: 9780134323718
Author: Stepp
Publisher: PEARSON CUSTOM PUB.(CONSIGNMENT)
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 13.3, Problem 22SCP
Consider the following sorted array of integers. When a binary search is performed on this array for each of the following integer values, what indexes are examined in order? What result value is returned?
- a. 25
- b. 0
- c. 11
- d. 2100
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Consider the array:
42 88 4 889 972 4561 34
If these items are sorted into descending order by the MSD Radix Sort algoirthm, what is the resulting sequence of items?
(enter each number, separated by a comma; do not use any spaces or quotation marks)
a. What is the largest number of key comparisons made by binary search in searching for a key in the following array?
3 14 27 31 39 42 55 58 61 64 69 73 77 80 85 89 93 98
b. List all the keys of this array that will require the largest number of key comparisonswhen searched for by binary search.c. Find the average number of key comparisons made by binary search in a successful search in this array. Assume that each key is searched for with the same probability.d. Find the average number of key comparisons made by binary search in an unsuccessful search in this array. Assume that searches for keys in each of the 19 intervals formed by the array’s elements are equally likely.
An array is a collection of similar data elements stored at contiguous memory locations. It is the
simplest data structure where each data element can be accessed directly by only using its index
number. The following is an array of unsorted numbers called NumArr.
NumArr:
24
56
78
79
34
75
2
23
Given the above array, demonstrate how a binary search can be performed. Indicate all the
necessary operations need to be performed using an algorithm or pseudocode.
Chapter 13 Solutions
EBK BUILDING JAVA PROGRAMS
Ch. 13.1 - Describe two ways to search an unsorted array of...Ch. 13.1 - Prob. 2SCPCh. 13.1 - Prob. 3SCPCh. 13.1 - Prob. 4SCPCh. 13.1 - Prob. 5SCPCh. 13.1 - Prob. 6SCPCh. 13.1 - Prob. 7SCPCh. 13.1 - Prob. 8SCPCh. 13.2 - Prob. 9SCPCh. 13.2 - Prob. 10SCP
Ch. 13.2 - Prob. 11SCPCh. 13.2 - Prob. 12SCPCh. 13.2 - Prob. 13SCPCh. 13.2 - Prob. 14SCPCh. 13.2 - Prob. 15SCPCh. 13.3 - Prob. 16SCPCh. 13.3 - Prob. 17SCPCh. 13.3 - Prob. 18SCPCh. 13.3 - Prob. 19SCPCh. 13.3 - Prob. 20SCPCh. 13.3 - Consider the following sorted array of integers....Ch. 13.3 - Consider the following sorted array of integers....Ch. 13.3 - Prob. 23SCPCh. 13.3 - Prob. 24SCPCh. 13.3 - Prob. 25SCPCh. 13.4 - Prob. 26SCPCh. 13.4 - Prob. 27SCPCh. 13.4 - Prob. 28SCPCh. 13.4 - Prob. 29SCPCh. 13.4 - Prob. 30SCPCh. 13 - Prob. 1ECh. 13 - Prob. 2ECh. 13 - Prob. 3ECh. 13 - Prob. 4ECh. 13 - Prob. 5ECh. 13 - Prob. 6ECh. 13 - Prob. 7ECh. 13 - Prob. 8ECh. 13 - Prob. 9ECh. 13 - Prob. 10ECh. 13 - Prob. 11ECh. 13 - Prob. 12ECh. 13 - Prob. 13ECh. 13 - Prob. 14ECh. 13 - Prob. 15ECh. 13 - Prob. 16ECh. 13 - Prob. 17ECh. 13 - Prob. 18ECh. 13 - Prob. 19ECh. 13 - Prob. 20ECh. 13 - Prob. 21ECh. 13 - Prob. 1PPCh. 13 - Write a program that discovers all anagrams of all...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Categorize each of the following items as either hardware or software: CPU C++ compiler ALU C++ preprocessor in...
C How to Program (8th Edition)
An online or hard-copy repository for all project correspondence, inputs, outputs, deliverables, procedures, an...
Essentials of Systems Analysis and Design (6th Edition)
Explain the difference between using a computer program and programming a computer.
Big Java Late Objects
Using the university schema, write an SQL query to find the IDs of those students who have retaken at least thr...
Database System Concepts
The ____________ is always transparent.
Web Development and Design Foundations with HTML5 (8th Edition)
Give a Java statement that will display a dialog window on the screen with the message I Love You.
Java: An Introduction to Problem Solving and Programming (8th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Given this array containing characters: Data В C F H J L M R S V X Z Index 1 3 4 5 7 8 9 10 11 12 13 List out the low, middle, and high indices for each pass when using binary search to locate the value 'Q' in the list. Use the following format for each pass needed: Pass: Low: Mid: High:arrow_forward3 7 1 7 9 4 5 8 1. Write down the steps of sorting the following array using Merge Sort. 2. Write down the steps of sorting the following array using Quick Sort.arrow_forwardUse the following sorted array to answer the following questions: 1 3 4 7 8 10 11 1 2 3 5 7 11 13 17 19 23 29 31 What values (not index) are examined in what order when searching for 19 using binary search? For example, when it examines whether 1, 3, 5 and 19 are equal to 19, write down 1, 3, 5, 19.arrow_forward
- Consider the following unsorted array. [234, 634, 1234, 210, 123, 542, 1021, 909, 321, 552, 135, 432, 1943, 53] In each column below, we give the intermediate results for some sort that has not yet completed. The left most column a is the original array (as shown above), and the last column i is the sorted result. 0234 0909 1021 0053 0123 0123 0234 0123 0053 0634 0210 0909 0123 0135 0210 0634 0053 0123 1234 1021 0542 0135 0210 0234 0210 0135 0135 0210 0321 0634 0210 0234 0542 0123 0210 0210 0123 0123 0552 0234 0321 0634 0542 0234 0234 0542 0432 0432 0321 0432 1021 0909 0542 0321 1021 0234 0053 0432 0542 1234 0321 1021 0432 0909 0634 0210 0542 0552 0321 0552 0909 0542 0321 1234 0321 0552 0634 0552 0135 0321 0552 0552 0135 0123 0634 0909 0909 0432 0552 0634 0135 0542 0135 0909 1021 0053 0053 1234 0909 0432 1943 0234 1021 1234 0135 1234 0432 1021 1943 0552 1234 1943 1943 0432 1021 1943 1234 0053 0053 1943 1234 0053 1943 1943 0634 1943 a b с d e (1) ய f g h iarrow_forwardGiven this array containing characters: Data M B A L J Z K C Ꭰ X Index 0 1 2 3 4 5 6 7 8 9 What does the list look like after one full run of the quick sort partitioning method, where the pivot is the low index value? Enter your answer with a space between each character, without commas. Aarrow_forwardLet N be an unordered array of integers. The maximum number of compares required to find the minimum value is N-1. [True/False]arrow_forward
- Consider the array {5, 8, 2, 6, 7}. How many exchanges are required to sort the given array using Bubble sort? a. 3 b. 8 c. 5 d. 7arrow_forwardWhat is the time complexity for the following code/program? 1.5 A binary search works like this: in a sorted array, the search algorithm compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array. What is the complexity of binary search? Why?arrow_forwardConsider the following array of characters: [b, i, e, d, h, a, f]; when it is being sorted with the Insertion sort, how many times the insertion operations would be performed to get fully sorted array? ? Select one: O a. 0 O b. 2 O C. 4 O d.1 Oe. 5 O f.6 Og. 3arrow_forward
- Question 1: Given array A = [10, 14, 19, 20, 21, 29, 32, 38, 47], fill the following table to show how BINARYSEARCH finds x. [3] In the table, the values low, high and mid are the first, last and mid index, respectively. The solution of the first table is provided for you as a hint. x=14 Iteration 1 2 3 4 (a)x=29 Iteration low 1 2 3 4 5 (b)x=47 low 1 1 3 4 5 (c) x=6 high 9 4 Iteration low high 1 2 high Iteration low high 1 2 3 4 5 Mid 5 2 mid mid I mid Afmid] vs x 21 > 14 14-14 A[mid] vs x Almid] vs x Almid] vs xarrow_forwardA merge sort is used to sort an array of 1000 test scores in descending order. Which of the following statements is true?a) The sort is fastest if the original test scores are sorted from smallest to largestb) The sort is fastest if the original test scores are in completely sorted order.c) The sort is fastest if the original test scores are sorted from largest to smallest.d) The sort is the same, no matter what the order of the original elements.arrow_forwardThe following list of numbers is the return value of a partitioning algorithm (Lomuto's or Hoare's, e.g.). Circle all possible valid pivots (the values the arrays were partitioned with). 2 1 3 5 4 10 8 14arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License