input: Write a python function to insert elements into a min heap and delete the minimum element.
  assert heap.insert(3) == None
  assert heap.insert(2) == None
  assert heap.insert(15) == None
  assert heap.delete_min() == 2
  assert heap.delete_min() == 3
  assert heap.delete_min() == 15
output: class MinHeap:
      def __init__(self):
          self.heap = []
  
      def insert(self, key):
          self.heap.append(key)
          self._heapify_up(len(self.heap) - 1)
  
      def delete_min(self):
          if not self.heap:
              return None
          if len(self.heap) == 1:
              return self.heap.pop()
          root = self.heap[0]
          self.heap[0] = self.heap.pop()
          self._heapify_down(0)
          return root
  
      def _heapify_up(self, index):
          parent = (index - 1) // 2
          if index > 0 and self.heap[index] < self.heap[parent]:
              self.heap[index], self.heap[parent] = self.heap[parent], self.heap[index]
              self._heapify_up(parent)
  
      def _heapify_down(self, index):
          smallest = index
          left = 2 * index + 1
          right = 2 * index + 2
  
          if left < len(self.heap) and self.heap[left] < self.heap[smallest]:
              smallest = left
          if right < len(self.heap) and self.heap[right] < self.heap[smallest]:
              smallest = right
          if smallest != index:
              self.heap[index], self.heap[smallest] = self.heap[smallest], self.heap[index]
              self._heapify_down(smallest)
  
  heap = MinHeap()