/// <summary>
 /// Insert a value to the stream
 /// </summary>
 /// <param name="val"></param>
 public void Insert(int val)
 {
     if (MaxHeapInst.HeapSize == 0)
     {
         MaxHeapInst.Insert(val);
         return;
     }
     if (MaxHeapInst.PeekMax() > val)                     // The val needs to go in MaxHeap
     {
         if (MaxHeapInst.HeapSize > MinHeapInst.HeapSize) // Make sure MaxHeap.Count does not go beyond MinHeap.Count + 1
         {
             MinHeapInst.Insert(MaxHeapInst.ExtractMax());
         }
         MaxHeapInst.Insert(val);
     }
     else // The val needs to go in MinHeap
     {
         if (MinHeapInst.HeapSize == MaxHeapInst.HeapSize) // Make sure that the MinHeap.Count does not go beyond MaxHeap.Count
         {
             MaxHeapInst.Insert(MinHeapInst.ExtractMin());
         }
         MinHeapInst.Insert(val);
     }
 }