Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming Google Flight is a ticket flight metasearch system that can compare multiple of flight tickets from other air flight companies. However, Google Flight

C programming

image text in transcribed

Google Flight is a ticket flight metasearch system that can compare multiple of flight tickets from other air flight companies. However, Google Flight received a complaint from the customer that the searching function was very slow. As a newly appointed programmer, you are required to improve the Google Flight system to make it more efficient and faster. Table 1 shows the example of one-way ticket flight search results from Kuala Lumpur to Kota Kinabalu. Table 1: Search results from Kuala Lumpur to Kota Kinabalu Air Flight Departure Time Price (RM) Malindo 18:10 - 20:40 158 Malindo 14:45-17:15 187 MAS 12:20 - 17:05 414 Malindo 09:10 - 11:40 150 Royal Brunei 12:10 - 17:05 368 MAS 17:50 - 20:35 307 a) Initially, prices for the entire ticket flights are unsorted. The scarching process more efficient when the list is arranged according to the prices. i. Develop a function sort Func(int list[], int length) to arrange the prices from cheapest to expensive using bubble sort algorithm where parameter list ( )is prices and length is the number of ticket flight. (5 Marks) ii. From the sorted list produced using the algorithm in a(i), analyse the sorting algorithm by illustrating the bubble sort processing cycle. (10 Marks) b) Construct a function binarySearch(int list(), int length, int searchItem) to search a budget within RM187 or less. Then, display all the corresponding prices. (10 Marks) Google Flight is a ticket flight metasearch system that can compare multiple of flight tickets from other air flight companies. However, Google Flight received a complaint from the customer that the searching function was very slow. As a newly appointed programmer, you are required to improve the Google Flight system to make it more efficient and faster. Table 1 shows the example of one-way ticket flight search results from Kuala Lumpur to Kota Kinabalu. Table 1: Search results from Kuala Lumpur to Kota Kinabalu Air Flight Departure Time Price (RM) Malindo 18:10 - 20:40 158 Malindo 14:45-17:15 187 MAS 12:20 - 17:05 414 Malindo 09:10 - 11:40 150 Royal Brunei 12:10 - 17:05 368 MAS 17:50 - 20:35 307 a) Initially, prices for the entire ticket flights are unsorted. The scarching process more efficient when the list is arranged according to the prices. i. Develop a function sort Func(int list[], int length) to arrange the prices from cheapest to expensive using bubble sort algorithm where parameter list ( )is prices and length is the number of ticket flight. (5 Marks) ii. From the sorted list produced using the algorithm in a(i), analyse the sorting algorithm by illustrating the bubble sort processing cycle. (10 Marks) b) Construct a function binarySearch(int list(), int length, int searchItem) to search a budget within RM187 or less. Then, display all the corresponding prices. (10 Marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago