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
zaharov [31]
3 years ago
12

Using the programs given in the appendix of this lab, write two programs: • One that will use a Linear search to find the amount

of time it takes to find (or not find) the number: 99,999,999. • One that will use a Binary search to find the amount of time it takes to find (or not find) the number: 99,999,999. • The only difference between the two programs will be the search function. • Record the amount of time it takes to do the Binary Search as well as the Linear search. • Run the test at least 5 times each.
Computers and Technology
1 answer:
miss Akunina [59]3 years ago
6 0

Answer:

// C++ code to linearly search x in arr[]. If x  

// is present then return its location, otherwise  

// return -1  

#include <iostream>  

using namespace std;  

int search(int arr[], int n, int x)  

{  

int i;  

for (i = 0; i < n; i++)  

 if (arr[i] == x)  

  return i;  

return -1;  

}  

int main(void)  

{  

int arr[] = { 2, 3, 4, 10, 40 };  

int x = 10;  

int n = sizeof(arr) / sizeof(arr[0]);  

int result = search(arr, n, x);  

(result == -1)? cout<<"Element is not present in array"

   : cout<<"Element is present at index " <<result;  

return 0;  

}  

You might be interested in
You receive a suspicious text message from an unknown sender asking you to click on a link to access your current credit score.
Lyrx [107]

Answer: Phishing

Explanation: A cybercrime in which, a target or targets are contacted by email, telephone or text message by someone acting or posing as a legitimate institution to lure these targets or a target into providing sensitive data such as personally identifiable information, banking and credit card details, and passwords is referred to as Phishing.

The CyberCriminals use these information to access important accounts, steal identities and even money.

Beside email and website phishing, there are phishing methods like 'vishing' (voice phishing), 'smishing' (SMS Phishing).

SOME FEATURES OF PHISHING EMAILS

The Emails are usually Too Good To Be True with a sense of Urgency, telling you to click on the link fast because the offers are limited.

They may tell you that your account will be suspended unless you update your personal details immediately and with attachments you are supposed to click on and from an unusual sender.

Whether it looks like it's from someone you know or don't know if anything seems out of the ordinary, unexpected, out of character or just suspicious please don't click on it the link. It might just be phishing.

7 0
3 years ago
What is the HIPAA privacy rule, and why does it affect IT professionals.
user100 [1]
It protects a persons identifiable health information and medical records.
4 0
2 years ago
The four levels of FBLA membership
Nataly_w [17]

Answer:

Future Business Leaders of America (FBLA) for high school students; FBLA-Middle Level for junior high, middle, and intermediate school students; Phi Beta Lambda (PBL) for post secondary students; and Professional Division for those not enrolled in school or post secondary school

Explanation:

7 0
3 years ago
Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and out
Fed [463]

Answer:

total = 0

for i in range(4):

   bill = float(input("Enter bill for quarter " + str(i+1) + ": "))

   total += bill

average = total / (4 * 3)

if average > 75:

   print("Average monthly bill is $" + str(average) + ". Too much water is being used")

if 25 <= average < 75:

   print("Average monthly bill is $" + str(average) + ". A typical amount of water is being used")

if average < 25:

   print("Average monthly bill is $" + str(average) + ". Thank you for conserving water")

Explanation:

*The code is in Python.

Create a for loop that asks the user to enter the bill for 4 quarters and calculate the total of the bills

Calculate the average monthly bill, divide the total by 12

Check the average for the given conditions. Depending on its value print the required message along with the average monthly bill

4 0
4 years ago
Computers infected by a virus, worm, or Trojan horse that allows them to be remotely controlled for malicious purposes are calle
yuradex [85]

Blaster Worm., the worm has been designed to tunnel into your system and allow malicious users to control your computer remotely. A Trojan horse is not a virus. It is a destructive program that looks as a genuine application. Unlike viruses, Trojan horses do not replicate themselves but they can be just as destructive.

4 0
3 years ago
Other questions:
  • What products use fabric manipulation
    8·1 answer
  • What represents the loss of a network signal strength measured in decibels (dB) and occurs because the transmissions gradually d
    7·1 answer
  • Alicia would like to make important text in her spreadsheet stand out. Alicia should _____
    8·2 answers
  • In spreadsheet software, the________________ feature ensures that the results in every cell are accurate for the information cur
    9·1 answer
  • How can you prevent the flash from going off no matter how much light there is iready
    7·1 answer
  • IOS 0R ANDR0ID ???
    13·1 answer
  • If someone wanted to talk to a financial institution representative in person they would need to _____.
    5·1 answer
  • Help ASAP!!! During which phase of a well-structured study session is each occurring?
    14·2 answers
  • What kind of waste does a computer generate?<br><br> Will give brainly :3
    12·1 answer
  • Help pleaseeeeeeee !!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!