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
Natasha_Volkova [10]
4 years ago
13

Suppose you with had two algorithms, A and B, with growth functions fa(n)=200n2 and fb(n)=2n4. If you were to do an exact analys

is on these growth functions, i.e., not simplify them with Big-Oh or tilde approximation, what algorithm would you recommend for which values of n? (Hint: you should be partitioning the domain of n > 0). Explain how you arrived at your answer and why it is correct.
Computers and Technology
1 answer:
anyanavicka [17]4 years ago
7 0

Answer:

For values when n<32 use fb(n) else use fa(n).

See explaination for details

Explanation:

Earlier when n=1 fa(n)=2000 while fb(n)=2. for n=2 fa(n)=2000*22 =2000*4=8000 while fb(n)=2*24=2*16=32. It is observed that fa(n) requires more time than fb(n) for small values.

Now, we will see when fb(n) crosses fa(n). This can happen only when fb(n) values equals or greater than fa(n)

therefore,

2000n2<=2n4

Solving equation we get n2>=1000 which can happen when n>=32.

So for values when n<32 use fb(n) else use fa(n)

You might be interested in
3. Write a program that inputs 4 hexadecimal digits as strings (example 7F), converts the string digits to a long – use strtol(i
never [62]

Answer:

#include <stdio.h>

#include <stdlib.h>

int main()

{

char num1[20],num2[20],num3[20],num4[20];

//Checks where the conversion of string to long stops and is required by strtol

char *ptr;

//Stores the converted number string into long.

long result_num1,result_num2,result_num3,result_num4;

//Prompt to enter all the four hexadecimal numbers.

printf("Enter the first hexadecimal number: ");

scanf("%s",num1);

printf("Enter the second hexadecimal number: ");

scanf("%s",num2);

printf("Enter the third hexadecimal number: ");

scanf("%s",num3);

printf("Enter the fourth hexadecimal number: ");

scanf("%s",num4);

//Converting the hexadecimal numbers into long using strtol() function with base 16 for hexadecimal.

result_num1 = strtol(num1,&ptr,16);

result_num2 = strtol(num2,&ptr,16);

result_num3 = strtol(num3,&ptr,16);

result_num4 = strtol(num4,&ptr,16);

//Casting the long to unsigned chars.

unsigned char numb1 = (unsigned char)result_num1;

unsigned char numb2 = (unsigned char)result_num2;

unsigned char numb3 = (unsigned char)result_num3;

unsigned char numb4 = (unsigned char)result_num4;

//Applying the boolean operation on unsigned chars and storing the resultant value in result.

unsigned char result = ((numb1&numb2)|numb3)^numb4;

//Printing the result in capital hex ("%X" take care of this).

printf("%X",result);

return 0;

}

Code OUTPUT

Enter the first hexadecimal number: 1 Enter the second hexadecimal number:2

Enter the third hexadecimal number: 3 Enter the fourth hexadecimal number: 4 Resultant Value: 7 Process returned o (0×0) execution time : 3.076 s

Press any key to continue

4 0
3 years ago
Data erasure software uses standards that are called.
Leviafan [203]

Data erasure software uses standards that are called Typically, a software program device is used for information erasure like BitRaser, which implements the overwriting sample primarily based totally on the usual used, together with US DoD 5220.22, NIST 800-88.

<h3>What is statistics erasure?</h3>

For virtual garage devices, erasing names after its developer, the Gutmann set of rules is a way of disk wiping that overwrites statistics the usage of a complete of 35 passes. This makes it one of the maximum steady statistics erasure methods, however additionally the maximum time-consuming.

The statistics manner that zeros and ones are verifiably overwritten onto all sectors of the device. This renders all statistics completely unrecoverable at the same time as retaining the capability of the device the beyond few years, NIST Special Publication 800-88 has end up the go-to statistics erasure preferred withinside the United States.

Read more about the software :

brainly.com/question/1538272

#SPJ1

8 0
2 years ago
Flashlights are known as which of the following
EastWind [94]
B. Battery powered lights
7 0
4 years ago
Read 2 more answers
____ is used specifically for the purpose of recording keystrokes, logging the programs or Web sites accessed, or otherwise moni
insens350 [35]

Answer:

Computer monitoring software

Explanation:

Computer monitoring software is used specifically for the purpose of recording keystrokes, logging the programs or Web sites accessed, or otherwise monitoring someone’s computer activity.

4 0
3 years ago
Read 2 more answers
What term describes one or more characters following the last period in a filename, such as .exe, .txt, or .avi?
elixir [45]

Answer:

Explanation:

.exe: is a file extension, means file that contain executable program which can be run by Microsoft windows.

.txt: is also file extension which contains text (characters).

.avi: means (audio video interleave) is a file extension, which contains audio and video data encoded.

3 0
3 years ago
Other questions:
  • A/An _______ occupies a continuous block of multiple pieces of data.
    6·2 answers
  • After brainstorming engineers may refine their ideas by making
    8·1 answer
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • The government department responsible for laws concerning work is the
    12·1 answer
  • Network address translation is useful because it enables
    5·1 answer
  • Which of the following scan only works if operating system’s TCP/IP implementation is based on RFC 793?
    12·1 answer
  • What is the default layout position for images added to a Word 2016 document?
    8·1 answer
  • Choose the answer. Janice's IT department found that her computer had a program on it that was collecting her personal informati
    5·1 answer
  • QUESTION 9 / 10
    13·1 answer
  • status is a non-volatile memory chip used for store translation data between personal computer PC and digital device ​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!