Program that will implement a binary search

Assignment Help Basic Computer Science
Reference no: EM13163625

Write a program that will implement a binary search. You program should store 40 numbers. The 40 numbers will be initialed in an array (See Below). Your program should read in each number, call a binary search, and Indicate if the number is found and if so where or if it is not in the list. Your program should also print the number before the number that was found and the number. For example, if you search for 31, then your program should display that 31 was found and the number before it is 29 and the number after it is 33.
int list[20] { 1, 4, 5, 6, 9,11,14,17,19,20, 22, 24, 25, 29, 31, 33, 35, 38, 40, 43, 45, 47,49, 50, 51, 55, 57 , 59, 61 , 63, 67, 69, 70, 72, 74, 77, 79, 80, 85, 92 }.

Reference no: EM13163625

Questions Cloud

Recall that a computer virus is malware : Recall that a computer virus is malware that relies on someone or something (other than itself) to propagate from one system to another. Write a computer virus that can be written to other empty text documents by running the batch program.
Atmega128 is being used to monitor humidity inside test cham : Atmega128 is being used to monitor humidity inside test chamber 03. The device uses two sensors to have some fault tolerance. They are connected to ADC channels 0 and 1. The program uses the average and maximum error of the two values.
The time delay of a long-distance : The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee
Write a function to compute the magnitude f : write a function to compute the magnitude F and direction angle of a two-dimensional force F by using two components of the force fx,fy as its parameters,returning F and using the reference to pass theta value .
Program that will implement a binary search : Write a program that will implement a binary search. You program should store 40 numbers. The 40 numbers will be initialed in an array (See Below). Your program should read in each number, call a binary search, and Indicate if the number is found ..
Write a function to convert the two dimensional coordinates : write a function to convert the two dimensional coordinates of a point from cartesian system to polar system by using x and y as its parameters
Write a program that computes the amount of money : Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is p..
Write a function to compute the volume of a cone : write a function to compute the volume of a cone by using the base radius r and the height h of the cone as the parameters of the function Vcone = xr^2h/3
Write a program that can be used to determine the tip amount : Write a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the total, before taxes and the tip percentage (15% or 20%). Produce output showing the calculated values including the ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is the global cpi for each implementation?

Given a program with a dynamic instruction count of 1.0E6 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which implementation is faster?"

  Function whose job is to output some sequence

Write a function whose job is to output some sequence of "interesting" #'s. The numbers should be separated from one another somehow so they don't all run together. This function may need to call another function, where the second function determines..

  Compare time complexity-convolution using direct convolution

Compare time complexity of convolution with n x n kernel when using: direct convolution with 2-D mask, and separable kernel.

  Object oriented programming paradigm

Discuss and explain why the object oriented programming paradigm is considered a better choice than the structured programming paradigm.

  Determine features of ram to include in web server

Determine the features and capacities (RAM, disk storage, processor speed) that Amy should include in the Web server computer that she will need for her site.

  Explain what occurs if instruction going through pipeline-lb

Consider processor with six stages: IF(instruction fetch), DA(instruction decode), CO(calculate operands addresses), FO(fetch operands), EX(instruction execution), WB(write results). Explain briefly what occurs in each stage when instruction going ..

  Continue to keep a journal

Continue to keep a journal of your activities and experience of using SAP. Include a copy of your full journal as an appendix to the reflective essay.

  Add a prompt to the condosales

Add a prompt to the CondoSales application to ask the user to specify a (1) garage or a (2) parking space, but only if the condo view selection is valid

  Explain people-organizational and technological components

What is meant by information system? How does it work? Write down its people, organizational, and technological components?

  Dscribe implications of e-publishing they effect way we read

Dscribe implications of e-publishing as they effect way we read and understand content. Describe e-books, print on demand, copyright and XrML and use of multimedia.

  Explaining mandatory access control implementation

How are Novell AppArmor and the Red Hat "targeted" SELinux policy similar? Is either a true Mandatory Access Control implementation. If not, explain why.

  Identify major points to include in communications plan

Identify the major points you would include in a communications plan at this point in the project? what advice would you give your project team to help it manage the user expectations?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd