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.
Instead of having to write multiple pieces of code for different outcomes, you can use an elseif statement and make your code easier to read and easier to understand.
Technician A is correct, there could be water or other contaminant in the brake fluid reservoir. The swollen cap needs to be replaced, some sell only the rubber part of the cap which could help save you money.
Answer:
Studying in groups can have many effective outcomes and be beneficial. Here are some ways studying in a group is benefical,
1. More support, limits chances of procrastination
<u> With many people, everyone is assigned a role or there is more determination by all peoples to get the work done than an individual being the only one responsible than many trying to accomplish the completion of the project. </u>
2. More people means more parts can get done effectively and taking notes is easier.
<u> More people allow the work (depending on the project of assignment) for the work to get more focused and worked on faster with the designated roles given. </u>
3. More interactive and allows (sometimes an enjoyable times) and to even learn faster than independently.
People, not all however, might like the company, there's support and even people skills is enhanced by being in the group.
Answer:
1. volatile data
2. temporary data
3. persistent data
seems like you already got it correct
Explanation: