Skip to content
Snippets Groups Projects

David

Open david.carballo requested to merge david.carballo/poo2019numeric:David into master
2 files
+ 51
10
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -23,6 +23,35 @@ final public class BinaryHeap
this.sort();
}
public int peek()
{
return this.get(0);
}
public int pop()
{
int val=this.peek();
this.set(0,0);
for(int i=0;i<this.depth();i++)
{
this.sort();
}
if(this.size()>0)
{
this.lstBinaryHeap.remove(this.size()-1);
this.taille--;
}
return val;
}
public void addAll(List<Integer> lst)
{
for(int val:lst)
{
this.push(val);
}
}
public boolean isEmpty()
{
if(this.size()==0)
Loading