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
A researcher develops a new instrument to measure coping skills and conducts a pilot study to compare the new tool with an exist
alexira [117]

Answer:b)convergence.

Explanation: Convergence has the basic meaning as when two or more unit of anything meet to converge or join. In the research , the different types of the tools are brought togather and skills and compare them.The measurement is done through the tools which has the already defined parameters.

Thus this concept is the example of the convergence because the tools are being converged and compared.so, the correct answer is option (B) and other option are incorrect because they have the technique of the contrasting and separation and reading respectively.

3 0
3 years ago
En una Memoria SD de 128 Gb, ¿Cuántas fotos en alta resolución de 16 Mb puedo almacenar?
fredd [130]

Answer:

Puedes tener 8.

You can have 8.

3 0
2 years ago
Why are there more producers then consumers?​
Ivanshal [37]

Answer:

because producer can make their own food

6 0
3 years ago
Read 2 more answers
A user has just clicked the OK button on a Web form. Which technology is often used to process information sent from the form?
Taya2010 [7]
Still cant tell which is which
7 0
3 years ago
QUESTION 5
lesya692 [45]
I’m pretty sure D but it should be like $B2
8 0
2 years ago
Other questions:
  • You use a ____ following the closing brace of an array initialization list.
    12·2 answers
  • ) Suppose algorithm A takes 10 seconds to handle a data set of 1000 records. Suppose the algorithm A is of complexity O(n2). Ans
    12·1 answer
  • Reggie has hired you to design a home network. The home network will share a printer but will mainly be used to stream movies to
    7·1 answer
  • Write a Python program to do the following:
    12·1 answer
  • Explain three applications of data mining
    14·1 answer
  • Rhea has been asked to interview the new CEO of an energy company. She has scheduled a meeting with him in the company’s meeting
    9·2 answers
  • Question 6 of 10
    11·1 answer
  • What is the first phone ever made?
    6·1 answer
  • Difference between Data and information​
    10·1 answer
  • A multiprocessor with 10 processors has 36 attached tape drives. A number of jobs have been submitted to the system where each j
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!