Introduction to Algorithm
Lab 1
1. Write a program to implement Bubble Sort to arrange a list of n integers in
ascending order.
2. Write a program to implement Selection Sort to arrange a list of n integers in
ascending order.
3. Write a program to implement Insertion Sort to arrange a list of n integers in
ascending order.
i. Implement all three algorithms in your preferred programming language.
ii. Compare their performance on different input sizes (n = 10, 100, 1000, …).
iii. Record the number of comparisons and swaps for each algorithm.
iv. Draw a table/graph to compare time complexity practically.