Infosys interview question

Asked me to write code for bubble sort and explain it.