1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xxMikexx [17]
3 years ago
13

1. Describe a linear search (explain how it works).

Computers and Technology
1 answer:
timurjin [86]3 years ago
7 0
1. A linear search searches on a straight path, hence the term “linear”. So a linear search would search from a one index to another in a straight path. For example, a linear search of an array, if given given the first and last index of the array, would search it one index after the other. First it would check index 0, then index 1, then index 2, and so forth.

2. A linear search can be useful if you are trying to find more than one instance of an value in a data structure. Since you want to search the whole array for each instance of the object or value.

3. A binary search only works with sorted data structures. It takes a data structure, finds its mid point, and checks I see if the value it is looking for is greater, less than, or equal to the midpoint value. If it is equal to the midpoint value, it’s finished and the search function is over.
If it’s greater than the midpoint, it disregards the lower half of the data structure and focuses on the upper half. If it’s less than the mid point then it disregards the upper half and focuses on the lower half.
It then repeats what it did at the beginning of the search function to again narrow down the amount of searching that needs to be done. In other words, if it disregarded the lower half of the data structure in the first part of the search, it finds the midpoint of the upper half of the data structure, checks to see if the value it’s looking for is greater than, less than, or equal to the midpoint. If it’s equal to it the searching is done, if it’s greater it disregards the lower half of the upper data structure, and repeats the process.
It will continue to do this until either the value is found or the value is not found.

4. You would use binary search if you are searching for one specific value in a sorted data structure.

5. A binary search must have a sorted data structure for it work.

6. Binary search is more efficient because the cost to run a binary search is substantially less than running a linear search.







You might be interested in
Ten output devices you know
jasenka [17]
Monitor
Printer
Headphones
Computer Speakers
Projector
GPS
Sound Card
Video Card
Braille Reader
Speech-Generating Device

6 0
3 years ago
What is your favorite film and what makes it good?
Gala2k [10]

Answer:

My Favorite film is The Old Guard

Explanation:

I like The Old Guard because it has action an etc.

4 0
2 years ago
Read 2 more answers
Write the name of the tab, the command group, and the icon that you need to use to justify text
const2013 [10]

Answer and Explanation:

In order to use the justified text

The name of the tab is the Home tab

The command is

First select the data in which you want to justify

Than go to the home tab after that go to the paragraph tab and then click on the dialog box launcher after that choose the drop-down menu of alignment and set justified text

The shortcut key is to use it is Ctrl + J

4 0
3 years ago
You work for the Contoso Corporation. You have a server that acts as a file server for clients. You must make sure that the serv
Anika [276]
Get a dedicated server with 6-10gb RAM, which might be able to run a lot, while staying up with no lag.
6 0
3 years ago
Assume you are part of the systems development team at a medium-sized organization. You have just completed the database design
nexus9112 [7]

Answer:

Please see the attached file for the complete answer.

Explanation:

Download pdf
5 0
3 years ago
Other questions:
  • 3. The following code will not display the results expected by the programmer. Can
    12·1 answer
  • Which of the following best describes a toolbar?
    9·1 answer
  • A cell reference that has only one $ is referred to as a(n) ____ cell reference. alternative mixed relative absolute
    7·1 answer
  • What does email etiquette mean?
    14·1 answer
  • Businesses use spreadsheets to keep track of financial________.
    14·1 answer
  • What is the trickiest time of the day to drive? A. Early morning B. Late night C. After the sun sets
    8·2 answers
  • How to print wireless from laptop to samsung printer?
    6·2 answers
  • Do u have to divide or multiply this problem 5300 yd = mi
    9·1 answer
  • Paul is a baker who wants to improve his recipe for muffins because they turn out with a greasy flavor. What ingredient should h
    14·1 answer
  • What java syntax allows me to take user input.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!