Skip to main content
deleted 121 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

One thing that I think need to be fixed is:

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

youYou need to copy it, otherwise the caller has reference to your array to corrupt it.

One thing that I think need to be fixed is:

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

you need to copy it, otherwise caller has reference to your array to corrupt it.

One thing that I think need to be fixed is:

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

You need to copy it, otherwise the caller has reference to your array to corrupt it.

Minor grammar
Source Link
Stephen Rauch
  • 4.3k
  • 12
  • 24
  • 36

One thing that iI think need to be fixed is:

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

you need to copy it  , otherwise caller has reference to your array to curruptcorrupt it  .

One thing that i think need to be fixed is

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

you need to copy it  , otherwise caller has reference to your array to currupt it  .

One thing that I think need to be fixed is:

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

you need to copy it, otherwise caller has reference to your array to corrupt it.

Source Link
sendi
  • 41
  • 3

One thing that i think need to be fixed is

private Heap12(E[] e){
  this.heap = e;                     // Set heap array to passed in array
  this.size = 0;                     // Size HAS to be 0 initially
}

you need to copy it , otherwise caller has reference to your array to currupt it .