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
Aneli [31]
3 years ago
14

Use the STL class vector to write a C function that returns true if there are two elements of the vector for which their product

is odd, and returns false otherwise. Provide a formula on the number of scalar multiplications in terms of n, the size of the vector, to solve the problem in the best and worst cases. Describe the situations of getting the best and worst cases, give the samples of the input at each case and check if your formula works. What is the classification of the algorithm in the best and worst cases in terms of the Big-O notation

Computers and Technology
1 answer:
Tema [17]3 years ago
7 0

Answer:

Code is provided in the attachment form

Explanation:

Vector Multiplication code:

Vector_multiplication.c file contains C code.

See attachment no 1 attached below

Classification of Algorithm: For creating elements in vector c of size n, number of scalar  multiplications is equal to n. The size of original two vectors scales directly with the number of  operations. Hence, it is classified as O(n).

You might be interested in
Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
erica [24]
Consensus Building is NOT a technique that you can use to help you in identifying a problem.
8 0
3 years ago
Bukod sa nakasulat na impormasyon ay makakakita rin ng larawan sa internet.​
faltersainse [42]

i woud love to help but i dont understand the language

7 0
2 years ago
PLEASE HELP!!! History abounds with instances in which the work of scientists and artists were affected by the political, religi
Masteriza [31]
Social Media affects them
7 0
3 years ago
Some students are studying the amount of pollution in a river They are using a computer to measure the pollution level using sen
Tpy6a [65]

Answer:

optical sensors

Explanation:

optical sensors measure the amount of gases like carbon dioxide and carbon monoxide in the air

4 0
2 years ago
What are the assignable addresses for the 12th subnet with the network address of 220.100.100.0 and the number of needed subnets
bogdanovich [222]

Answer:

C. 220.100.100.45 to 220.100.100.46

Explanation:

The Classless IP subnetting of 220.100.100.0 begins from the fourth octet of the IP address. To get 45 subnet mask, it uses 6 bits from the fourth octet, which approximately give 64 subnets, while the remaining 2 bits are used for host IP addressing.

The useable host IP addresses are gotten from the formula '2^{n}-2', with n=2 bits.

useable host IP addresses = 2^2 - 2 = 2 addresses per subnet.

While the 12th subnet is 12 x 2^2 = 44.

This means that the 12th subnet mask starts with 220.100.100.44 (as the network address) and ends with 220.100.100.47 as broadcast IP address, while '.45' and '.46' are the assignable addresses of the subnet.

5 0
2 years ago
Other questions:
  • What are the example of dedicated computers?
    5·1 answer
  • One of the most toxic components of a computer is the
    11·1 answer
  • What network setting do i need for a workgroup?
    5·1 answer
  • Which one of the following items is an example of software?
    15·1 answer
  • PLEASE DON'T DELETE THIS QUESTION!!!!
    15·2 answers
  • When choosing a new computer to buy, you need to be aware of what operating it uses.
    12·1 answer
  • Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o
    7·1 answer
  • David would like to send a letter to more than one hundred people. He would like the letter to have names and addresses inserted
    12·2 answers
  • The _____ feature will mark all changes made to a document for others to review at a later time.
    13·1 answer
  • Http://www.alegrium.com/sgi/2/eibder
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!