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

Lab 2

This document provides instructions for a lab assignment on searching and sorting algorithms. Students are asked to write functions to demonstrate sequential search, binary search, selection sort, insertion sort, bubble sort, and more advanced sorting and searching algorithms. They are also asked to use these algorithms to search and sort data about football players from a provided file to find players by birth year, club, position and club, and to sort the players by birth year and last name.

Uploaded by

Long Nguyễn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lab 2

This document provides instructions for a lab assignment on searching and sorting algorithms. Students are asked to write functions to demonstrate sequential search, binary search, selection sort, insertion sort, bubble sort, and more advanced sorting and searching algorithms. They are also asked to use these algorithms to search and sort data about football players from a provided file to find players by birth year, club, position and club, and to sort the players by birth year and last name.

Uploaded by

Long Nguyễn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming Techniques Knowledge Engineering Department

Lab 2: Searching and Sorting


Write functions to demonstrate the following algorithms:

1 Searching
• Sequential Search

• Binary Search

Advance:
• Sequential Search (with sentinel)

• Recursive Binary Search

• Interpolation Search

2 Sorting
• Selection Sort

• Insertion Sort

• Bubble Sort

• Interchange Sort

Advance:
• Insertion Sort (with sentinel)

• Binary Insertion sort

• Improved Bubble Sort

• Shaker Sort

3 Practical problem
Given the file "Players.txt" containing information about football players. Each player’s information is described on one
line, with the format:

Position/Name/Year of birth/National team/Club

Demonstrate the following actions:

• Find all players born in 1994.

• Find all players who play for Manchester United club.

• Find all FW play for Manchester City.

• Sort the players ascendingly by their year of birth and last name.

Page 1 / 1

You might also like