MCPcopy Index your code
hub / github.com/kunal-kushwaha/DSA-Bootcamp-Java / upheap

Method upheap

lectures/27-huffman-coding/code/Heap.java:18–30  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

16 return list.size();
17 }
18 private void upheap(int index){
19
20 if(index == 0){
21 return;
22 }
23
24 int p = parent(index);
25
26 if(list.get(index).compareTo(list.get(p)) < 0){
27 swap(index, p);
28 upheap(p);
29 }
30 }
31
32 public T remove() throws Exception{
33 if(list.isEmpty()){

Callers 1

insertMethod · 0.95

Calls 4

parentMethod · 0.95
swapMethod · 0.95
compareToMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected