package uk.ac.cam.josi2.DataStructures;

/**
 * Created by Joe on 08/04/2015.
 */
public class FibonacciHeap {
}

@@ -105,9 +105,1117 @@
 Heap
- %7B
+%3CT extends Comparable%3CT%3E%3E %7B%0A    private FHeapNode mMin;%0A%0A    private int mNumOfNodes;%0A%0A    public FibonacciHeap()%7B%0A        mMin = null;%0A        mNumOfNodes = 0;%0A    %7D%0A%0A    public void insert(T key)%7B%0A        FHeapNode newNode = new FHeapNode(key);%0A        if(mMin == null) %7B%0A            mMin = newNode;%0A        %7D%0A        else%7B%0A            mMin.insertIntoChildList(newNode);%0A            if(mMin.mKey.compareTo(newNode.mKey) %3E 0)%7B%0A                mMin = newNode;%0A            %7D%0A        %7D%0A        mNumOfNodes++;%0A    %7D%0A%0A%0A    private class FHeapNode %7B%0A        FHeapNode mParent, mChild, mLeft, mRight;%0A        T mKey;%0A        boolean mMarked;%0A%0A        int mDegree;%0A%0A        public FHeapNode(T key)%7B%0A            mMarked = false;%0A            mDegree = 0;%0A            mLeft = this;%0A            mRight = this;%0A            mParent = null;%0A            mChild = null;%0A            mKey = key;%0A        %7D%0A%0A        public void insertIntoChildList(FHeapNode child)%7B%0A            child.mLeft = this;%0A            child.mRight = mRight;%0A            child.mRight.mLeft = child;%0A            child.mLeft.mRight = child;%0A        %7D%0A%0A    %7D
 %0A%7D%0A

Can insert into a FibonacciHeap