retagged by
620 views
0 0 votes

Consider the following pseudo code. What is the total number of multiplications to be performed?

D = 2

for i = 1 to n do

   for j = i to n do

      for k = j + 1 to n do

           D = D * 3

(a) Half of the product of the 3 consecutive integers

(b) One-third of the product of the 3 consecutive integers

(c) One-sixth of the product of the 3 consecutive integers

(d) None of the above

Solution: Option (c)

1 Answer

Position:
Show:

Related questions

0 0 votes
2 2 answers
727
727 views
Mak Indus asked Nov 10, 2018
727 views
Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]= i.(a) O (1) ...
1 1 vote
1 1 answer
2.2k
2.2k views
Mak Indus asked Nov 6, 2018
2,235 views
. Assume an array A[1….n] has n-elements, and every element of an array is less than or equal to n. An element is said to be majority element, if it occurred in more than...
5 5 votes
1 answers 1 answer
1.8k
1.8k views
ankitgupta.1729 asked Nov 9, 2017
1,805 views
33. Which of the following statements about max heap are true ?(I) To find the kth largest element in the heap, the time required is $\mathrm{O}(\mathrm{klogn})$, where k...
0 0 votes
1 1 answer
863
863 views
Sk Jamil Ahemad asked Feb 1, 2022
863 views
Please explain with some example that How Right to Left associativity takes place in case of Ternary operators?