Respuesta :
The function void heap::downheap(int anindex) algorithm is correct, and your code should compile.
void Heap::ReHeapDown(int index, int bottom)
{ int maxnode, rightnode, leftnode;
leftnode = index * 2 + 1;
rightnode = index * 2 + 2;
if (leftnode <= bottom)
{ if (leftnode == bottom)
maxnode = leftnode;
else
{
if (m_elements[leftnode] <= m_elements[rightnode])
maxnode = rightnode;
else
What is algorithm in programming?
A step-by-step process called an algorithm specifies a series of directives that must be followed in a particular sequence in order to yield the desired outcome.
The fact that algorithms are typically developed independently of the underlying languages means that an algorithm can be implemented in multiple programming languages.
An algorithm has a number of qualities, including clarity, fineness, effectiveness, and language independence. An algorithm's importance is primarily influenced by how well it scales and how well it performs.
- When a computer performs calculations or other problem-solving tasks, it must follow a set of instructions called an algorithm.
- An algorithm is formally defined as a finite set of instructions that are followed in a particular order to complete a specific task.
Learn more about algorithm
https://brainly.com/question/29558545
#SPJ4