MetricStream interview question

They asked me to write an algorithm for bubble sorting