title: Abort() has been called Error while debugging C++
body: <p>i am trying to implement simple binaryHeap and this part is a percolateDown part however when it comes to else part, it crashes and gives me abort() error , it happens in after i continue "}else{" line. I dont understand the problem and i am a bit new in C++.</p>
  
  <pre><code>void BinaryHeap::percolateDown(int hole) {
  
      int leftChild = hole * 2;
  
      if (leftChild&gt;size){
          //DO NOTHING AND ROLLS BACK IN RECURSION
      }else{
          int minIndex = hole;
          if (heap[minIndex] &gt; heap[2 * hole]){
              minIndex = 2 * hole;
          }
          if (heap[minIndex] &gt; heap[2 * hole + 1]){
              minIndex = 2 * hole + 1;
          }
          swap(hole, minIndex);
          percolateDown(minIndex);
      }
  
  }
  </code></pre>