Question: C code only for this question please: You learned about priority queues recently and are now ready to solve problems using them! So here's one.
C code only for this question please:
You learned about priority queues recently and are now ready to solve problems using them! So here's one. Suppose you have an integer array A. For each index i, you want to find the product of the largest, second largest and the third largest integer in the range [1,i). Note: Two numbers can be the same value-wise but they should be distinct index-wise. Input: The first line contains an integer N, denoting the number of elements in the array A. The next line contains N space separated integers, each denoting the ith integer of the array A. Output: Print the answer for each index in each line. If there is no second largest or third largest number in the array A upto that index, then print "-1", without the quotes. Constraints: 1
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
Cod... View full answer
Get step-by-step solutions from verified subject matter experts
