Implement Heap Insert

Write pseudocode or code for the add(value) operation of a binary min-heap.

The heap is stored in a zero-indexed array. add(value) must:

  1. Append value to the end of the array;
  2. Repeatedly ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: