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
anastassius [24]
2 years ago
5

Which searching method requires that the list be sorted?

Computers and Technology
1 answer:
cricket20 [7]2 years ago
8 0

Answer:

Binary Search

Explanation:

Binary search is a search which we can apply on sorted list. This search compares the search element with the middle  element of the list. If it is greater than the middle element then again we apply search on right list

if it is less that the list then it will apply search on left list. This process happens recursively until you find the search element.

In Worst and average Case Performance :0(nlogn)

You might be interested in
Find the root using bisection method with initials 1 and 2 for function 0.005(e^(2x))cos(x) in matlab and error 1e-10?
frutty [35]

Answer:

The root is:

c=1.5708

Explanation:

Use this script in Matlab:

-------------------------------------------------------------------------------------

function  [c, err, yc] = bisect (f, a, b, delta)

% f the function introduce as n anonymous function

%       - a y b are the initial and the final value respectively

%       - delta is the tolerance or error.

%           - c is the root

%       - yc = f(c)

%        - err is the stimated error for  c

ya = feval(f, a);

yb = feval(f, b);

if  ya*yb > 0, return, end

max1 = 1 + round((log(b-a) - log(delta)) / log(2));

for  k = 1:max1

c = (a + b) / 2;

yc = feval(f, c);

if  yc == 0

 a = c;

 b = c;

elseif  yb*yc > 0

 b = c;

 yb = yc;

else

 a = c;

 ya = yc;

end

if  b-a < delta, break, end

end

c = (a + b) / 2;

err = abs(b - a);

yc = feval(f, c);

-------------------------------------------------------------------------------------

Enter the function in matlab like this:

f= @(x) 0.005*(exp(2*x)*cos(x))

You should get this result:

f =

 function_handle with value:

   @(x)0.005*(exp(2*x)*cos(x))

Now run the code like this:

[c, err, yc] = bisect (f, 1, 2, 1e-10)

You should get this result:

c =

   1.5708

err =

  5.8208e-11

yc =

 -3.0708e-12

In addition, you can use the plot function to verify your results:

fplot(f,[1,2])

grid on

5 0
3 years ago
In a program, you need to store the identification numbers of 10 employees (as integers) and their weekly gross pay (as double v
dedylja [7]

Answer:

The code to the given question can be given as:

Code:

1)

2 arrays that used to store 10 employee identification number and grosspay amount in parallel and its data-type is int and double.

int Employee_id[10]; //array that store integer value

double Weekly_Gross_Pay[10]; //array that store double value

2)

Define loop for print the details of employees’ identification number and weekly gross pay.

for(int i=0; i<10; i++)  

{  

cout <<Employee_id[i] <<" " << Weekly_Gross_Pay[i] << endl;  

}

Explanation:

The explanation of the above code can be given as:  

In Code (1) we declare two array that's data-type is integer and double. In Employee_id array it store the integer values and Weekly_Gross_Pay it store the double value.

In Code(2) It is used to print the value of array. In that code, we used for a loop because of its entry control loop and we know the size of the array. In this loop, we declare a variable (i) and initialized the value 0 and check the condition(i)less than 1 and increment of i. It prints all the 10 values.  

5 0
3 years ago
What is the ribbon in the word document
adoni [48]

Answer:

The Ribbon is a user interface element which was introduced by Microsoft in Microsoft Office 2007. It is located below the Quick Access Toolbar and the Title Bar. It comprises seven tabs; Home, Insert, Page layout, References, Mailing, Review and View. Each tab has specific groups of related commands

Explanation:

8 0
3 years ago
SOMEONE HELP PLEASE ​
exis [7]
Do what?? please tell me
3 0
2 years ago
Why should computers have a file structure? For organization For storing code To prevent viruses To keep back-ups of files
AURORKA [14]

Answer: I believe the answer to your question is  For organization I hope this helps!  

8 0
2 years ago
Other questions:
  • What are 3 characteristics of syndrome E?
    13·1 answer
  • Describe three main types of testing and the order in which they are performed.
    9·2 answers
  • Write an application named [LastName]_MultiplicationTable and create a method that prompts the user for an integer value, for ex
    11·1 answer
  • How do I get more points?
    13·2 answers
  • You change a document that is saved on your computer by cutting text from the document what happens to the text when you preform
    5·1 answer
  • Describe some common types of charts.​
    13·2 answers
  • . In this project, how many times will the [Drive] block be repeated?
    15·1 answer
  • How does digital and hybrid computers differ in portability​
    9·1 answer
  • Which image file format consumes the most file<br> space?<br> 0<br> GIF<br> JPEG<br> PNG
    7·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!