MetricStream Interview Question

They asked me to write an algorithm for bubble sorting