Store all min element from minHeap
List < int > minList = new List < int > ( ) ; while ( minHeap . Count > 0 ) { minList . Add ( minHeap [ 0 ] ) ; minHeap . RemoveAt ( 0 ) ; } int mindiff = Int32 . MaxValue ;