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
I know this isn't a school question but it is important! how do I get out of hp hardware diagnostics UEFI on hp pc? (step by ste
Debora [2.8K]

Answer:

1. Turn off the computer and wait five seconds.

2. Press the Power button to start the computer and repeatedly press the F10 key to enter the BIOS setup menu.

3. On the BIOS Setup screen, press F9 to select and load the BIOS Setup Default settings.

4. Press F10 to Save and Exit.

5. Use the arrow keys to select Yes, then press Enter when asked Exit Saving Changes?

6. Follow the prompts to restart your computer.

After you have get to the operating system,

1. Press CTRL + Alt + Del on the blank screen.

2. Click on Task Manager

3. Click "File" - "Run a new task" If there is no "file" option, please click on the task manager under the "details"

4. In the pop-up window, enter "msconfig" click "OK"

5. In the system configuration window that appears, click "Service" and uncheck "App Readiness".

6. Click "Apply" --- "OK"

7. In the following window appears to click on the "restart"

6 0
3 years ago
Which feature of a word processing program enables you to represent any numerical data in the form of a diagram?
WARRIOR [948]
I think the answer to this is SmartArt. it helps you create any type of diagrams in either powerpoints or word. 
7 0
3 years ago
Read 2 more answers
I have a question about my HP Laptop
vekshin1
What exactly is your question?
7 0
3 years ago
Which statement about technology before the invention of the printing press is true?
marta [7]

Answer: See explanation

Explanation:

You didn't give the options to the question and I searched and couldn't find the particular question.

Here, are some of the things about technology before the invention of the printing press.

1. Before printing press, monks copied books such as bibles as they'll copy calligraphy and illustrations in order for them to spread the messages in the Bible across to people.

2. Before printing press, oral communication was the way that people communicated with each other.

3. Drawings and writings were done by hand before printing press.

4. Before the invention of printing press, in order to transcribe books, different materials that were used include wax, parchment, clay and papyrus.

8 0
2 years ago
Which of the following statements Terminates the program andstops all threads?
Law Incorporation [45]

Answer:

(c) system.exist(1);

Explanation:

system.exist(1); is used for the termination of the program here both option c and d should be correct but in option d there is exit(0) and zero indicates return means program will return but besides zero if there is any non zero number then program will not return and in option c there is a non zero number which means program will not return so option c  system.exist(1); will be the correct option for the termination of program

8 0
3 years ago
Other questions:
  • The following is true about SPAM ________.
    9·1 answer
  • Sequentially prenumbered forms are an example of a(n): a. Processing control. b. Data transmission control. c. Input control. d.
    10·1 answer
  • Which Google Analytics visualization compares report data to the website average?A. Pivot viewB. Comparison viewC. Performance v
    8·1 answer
  • To a traditional computer, one means
    8·1 answer
  • What is the name for a hardcoded value entered into a formula ?
    8·2 answers
  • ---------------is a systematic review of a person’swork and achievements over a recent period, usually leading toplans for the f
    11·1 answer
  • Which two statements are true about algorithms?
    15·2 answers
  • Design and implement an application that reads a string from the user then determines and prints how many of eachlowercase vowel
    8·1 answer
  • Please help with this:
    10·1 answer
  • Which of the following CANNOT incorporate animation
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!