Given the size of array heap 'A' say 50 million, on calling MAX-HEAPIFY (A,300), how can I calculate the maximum and minimum no. of exchanges that can take place?

Figure out the maximum number of exchanges that can take place in the MAX_HEAPIFY routine. Figure out the max number of times it can be recursively called (Ex: lgn), then multiply those two numbers and you have your answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.