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

Answers

Answer 1
Answer:

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).


Related Questions

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century".
The section on the Publisher screen that allows you to quickly move from one page another in a publication is the _____. View tabPage panePage Design tabZoom bar
What two benefits are a result of configuring a wireless mesh network? Check all that apply. 1. Performance 2. Range 3. WiFi protected setup4. Ad-hoc configuration​
your manager ask you to set up a secure network connection at a remote site which protocol would you use
What are the two types of vertical spacing for paragraphs

When people receive benefits just because they belong to a particular identity group, this is called

Answers

Answer:discrimination

Explanation:

Which of the following is a central feature of agroup?interactionmutual influenceinterdependenceall of the given options

Answers

Answer: All of the above

Explanation: A group is considered as the collection of two or more constituents/individuals. The characteristics of the a group are interaction , interdependence,interaction etc. There is a sense of responsibility and trust to work to achieve goal by depending on each other is described as the interdependence and for this interaction between group is needed as to maintain good communication and also there is a influence of each other on each group member.

Is e commerce a challenge or opportunity to the freight forwarder

Answers

Answer:

It can be both

Explanation:

This all depends on how that e commerce is planning on handling their deliveries. Taking Amazon as an example, they're probably top customers from FedEx and UPS (and others as well), which at a very beginning this has shown a great opportunity for these companies. However, Amazon has started to show interest in starting their own delivery which also poses a huge risk.

Express the worst case run time of these pseudo-code functions as summations. You do not need to simplify the summations. a) function(A[1...n] a linked-list of n integers) for int i from 1 to n find and remove the minimum integer in A endfor endfunction

Answers

Answer:

The answer is "O(n2)"

Explanation:

The worst case is the method that requires so many steps if possible with compiled code sized n. It means the case is also the feature, that achieves an average amount of steps in n component entry information.

  • In the given code, The total of n integers lists is O(n), which is used in finding complexity.
  • Therefore, O(n)+O(n-1)+ .... +O(1)=O(n2) will also be a general complexity throughout the search and deletion of n minimum elements from the list.

Plz answer me will mark as brainliest ​

Answers

Answer:

D is the answer

Explanation:

because arteriales don't requare valves because they only go to one direction

Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 80 and 40 bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acknowledgment whenever it receives a segment from Host A. In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?

Answers

Answer:

sequence number = 207

source port number = 302

destination port number = 80

Explanation:

The sequence number is 127 + 80 = 207

The source port number is 302, and the destination port number is 80.