Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
61 views

Activity 5 - Search and Sorting Algorithms

The document describes an activity on search and sorting algorithms. Students will learn sequential search, binary search, selection sort, bubble sort, insertion sort, mergesort, radix sort, and counting sort. Exercises involve sorting lists of students using different sorting algorithms and searching the lists using binary search. Students must analyze sorting algorithms based on time complexity and scenarios for best use. Big O notation is discussed in analyzing efficiency for large data sets.

Uploaded by

Laurence Capati
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)
61 views

Activity 5 - Search and Sorting Algorithms

The document describes an activity on search and sorting algorithms. Students will learn sequential search, binary search, selection sort, bubble sort, insertion sort, mergesort, radix sort, and counting sort. Exercises involve sorting lists of students using different sorting algorithms and searching the lists using binary search. Students must analyze sorting algorithms based on time complexity and scenarios for best use. Big O notation is discussed in analyzing efficiency for large data sets.

Uploaded by

Laurence Capati
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
You are on page 1/ 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