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

Lab 04 DSA

Uploaded by

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

Lab 04 DSA

Uploaded by

Đức Triển
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab 4 - Searching and Sorting

Problem 1. Write a program that stores an array of 1000 random integers between 1
and 10000. The program should include the following functions:
a) Input and output data of the array.
b) Sort the array by using all sorting algorithms that you have studied.
c) Compare the execution time of the sorting algorithms and write the result to a
file named “SortingTime.txt”.
d) Search for a given element x from the array using linear search technique.
e) Search for a given element x from the array using binary search technique

Problem 2. You want to develop an application managing a list of students. The


information of a student is defined as follows:
struct Student
{
char id[12];
char name[30];
char class[10];
float mMath;
float mPhysical;
};
Write a program including the following functions:
a) Input, output a list of student.
b) Search a student by identification.
c) Sort the list in descending order based on avg (avg = (mMath+ mPhysical)/2).

You might also like