You are on page 1of 6

Activity No.

5
Search and Sorting Algorithms
Course Code BCS 120 Program:
Course Title Fundamentals of Programming Date Performed:
and Data Structures
Section: Date Submitted:
Name: Instructor:
1. Objective:
The goal of this laboratory activity is to learn and apply the different sorting algorithms,
specifically, sequential search, binary search, selection sort, bubble sort, insertion sort,
mergesort, radix sort, and counting sort
2. Intended Learning Outcomes (ILOs):
After completion of this activity the students should be able to:
2.1 Write a short program to sort out various data sets using the above
algorithms
2.2 Execute programs to modify the order of data and search for specific
values
2.3 Examine the application of sorting and identify the different advantages
and disadvantages of each algorithm
3. Resources:
Computer with 32-bit Operating System
Dev C++

4. Procedure:
Programming Exercise A
Use selection sort to sort out 5 students in a list (last name), then apply binary
search to search for a specific student. Display the number of comparisons
made. Display the number of comparisons made in the sorting algorithm and
binary search.
Programming Exercise B
Use bubble sort to sort out 5 students in a list (last name), then apply binary
search to search for a specific student. Display the number of comparisons made
in the sorting algorithm and binary search.

Programming Exercise C
Use insertion sort to sort out 5 students in a list (last name), then apply binary
search to search for a specific student. Display the number of comparisons made
in the sorting algorithm and binary search.

Programming Exercise D
Create a program that will sort the data set, {12, 11, 13, 5, 6, 7} using
mergesort. The program must display all steps performed.
5. DATA ANALYSIS:
1. Differentiate bubble sort, insertion sort, mergesort, radix sort, and counting
sort in terms of time complexity. Give scenarios on when to best use each
sorting algorithm.

2. What makes binary search faster than sequential search? When can you only
use binary search?

3. Sort the sequence 8, 1, 4, 1, 5, 9, 2, 6, 5 by using


a) Insertion sort
b) Mergesort
c) Bubble Sort
*list down all the steps and the arrangement of the data set after each
step

ex.
321
231
213
123
123

4. What is the Big O notation? How does it apply to the sorting algorithms and
what makes it a factor to consider when dealing with large data sets?
7. DISCUSSION
8. CONCLUSION
9. Assessment (Rubric for Laboratory Performance):

You might also like