0% found this document useful (0 votes)
33 views

MSE622 Search Algorithm Laboratory Activity

This document outlines a laboratory exercise to implement and compare the performance of various search algorithms. Students are instructed to: [1] Code two search algorithms, [2] Generate test data sets of different sizes, [3] Measure the execution times of each algorithm on each data set, and [4] Analyze and report on the performance results. The goal is to evaluate how data set size impacts algorithm efficiency.

Uploaded by

Arthur Aguilar
Copyright
© © All Rights Reserved
0% found this document useful (0 votes)
33 views

MSE622 Search Algorithm Laboratory Activity

This document outlines a laboratory exercise to implement and compare the performance of various search algorithms. Students are instructed to: [1] Code two search algorithms, [2] Generate test data sets of different sizes, [3] Measure the execution times of each algorithm on each data set, and [4] Analyze and report on the performance results. The goal is to evaluate how data set size impacts algorithm efficiency.

Uploaded by

Arthur Aguilar
Copyright
© © All Rights Reserved
You are on page 1/ 4

Laboratory Exercise - Search Algorithms

Godofredo Avena
MSE 622
May 7, 2023
Laboratory Exercise - Search Algorithms

Objective: To implement and compare the performance of various search algorithms on different data sets.

Materials:
Computer with Python installed (https://www.python.org/downloads/)
Integrated development environment (IDE) for writing Python code (https://code.visualstudio.com/download)

Instructions:
Part 1: Implementing Search Algorithms

Implement any two search algorithms in Python (code already provided) :


• Linear search
• Binary search
• Jump search
• Exponential search
• Interpolation search
• Ternary Search

Note: You can refer to the earlier explanations and the code provided for each algorithm to help you with the
implementation.
Part 2: Generating Test Data

Create three different data sets for testing the search algorithms:
a. Small data set: Generate a sorted list of 100 integers.
b. Medium data set: Generate a sorted list of 1,000 integers.
c. Large data set: Generate a sorted list of 10,000 integers.

Choose a random target element from each data set to search for.

Part 3: Testing and Comparing Search Algorithms

For each search algorithm, measure the time taken to find the target element in each data set. A
code has been given but you can change it to get a more efficient answer.

Record the execution times for each algorithm and data set combination.
Part 4: Analysis and Conclusion

Create a table or graph to visualize the performance of each search algorithm on the different data sets.

Analyze the results and answer the following questions:


a. Which search algorithm performed the best overall?
b. Did any search algorithms perform better on specific data sets?
c. How did the size of the data set affect the performance of the search algorithms?
d. Write a brief conclusion summarizing your findings

Deliverables:

Python code for each search algorithm (already provided)


Table or graph comparing the performance of the search algorithms on the different data sets
Analysis and conclusion of the exercise

You might also like