0% found this document useful (0 votes)
3 views1 page

Sorting Algorithms: Bubble, Selection, Insertion

Uploaded by

varunrajss07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Sorting Algorithms: Bubble, Selection, Insertion

Uploaded by

varunrajss07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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.

You might also like