DXC Technology Interview Question

Whats the logic behind Bubble sort?