Cognizant interview question

Write an algorithm for bubble sort.