subject

We live in the sea of information. It gets even more serious with the Internet. Think about all the information and data sorted globally waiting to be shared. We often need to find one particular item amongst so many of them. There are too many examples to name a few - trying to find someone's phone number on your phone, the most popular Ethiopian restaurant in Colorado, how to interpret a dream you had last night, 1998 Super bowl Winner, ...
This is why fast searching algorithms are critical. If you linearly (sequentially) traverse each item in an available data set-for example of each phone number in your phone - individually, to see whether it is what you are looking for, in a very large set of data, it will take a few hours or days to finish it. Instead, the binary searching algorithm can be used to help find the item in a much shorter time.
However, with un-preprocessed data (completely random data), there is no way you can do better than linear search (a. k.a. sequential search, Textbook page 211). But, if the data is pre-processed (sorted), then you can use the Binary Search (wiki) algorithm to mprove the search time dramatically. In this 3/6/2021 Program Assignment 4 - Searching, Sorting, and Drawing shapes (Mar 14) you are asked to implement the basic binary search algorithm and the insertion sorting algorithms. You will learn more about these two topics (Sorting and Searching) when you take Data Structure and Algorithms classes.
Binary search: the most fundamental searching algorithm within a sorted array. It finds the position of a target value by comparing 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. This algorithm takes logarithmic time (log n) (big-oh of log ncomparisons where n is the number of elements in an array. (Don't worry too much about Big-O notation if you don't understand it now)
Based on this binary search algorithm, we want to play a well-known guessing game that guarantees to find the target value in log n times. (1 Billion vs 30, 1Trillion vs 40 searches) Please read the following article for more information about the binary search: Following is what you are asked to do in C++: The function and file names are just examples. You may pick up your own name.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
You know the right answer?
We live in the sea of information. It gets even more serious with the Internet. Think about all the...
Questions
question
Computers and Technology, 18.05.2021 14:00
question
Mathematics, 18.05.2021 14:00
question
Computers and Technology, 18.05.2021 14:00
question
Computers and Technology, 18.05.2021 14:00
question
Mathematics, 18.05.2021 14:00
question
Mathematics, 18.05.2021 14:00
question
Mathematics, 18.05.2021 14:00
question
Chemistry, 18.05.2021 14:00
question
Mathematics, 18.05.2021 14:00
question
Biology, 18.05.2021 14:00
Questions on the website: 13722367