The manager of the team comes over to you and tells you he needs a simple process in place to sort through the raw lap times which is currently just a list of numbers (in seconds) in an array: lap_times = [76.43, 77.92, 74.35, 80.12, 75.10, 76.43, 76.01, 75.35] You need to design an algorithm (you can use a programming language or pseudo code if you wish) to sort the lap times into ascending order. You should consider how to do it in as few lines of code as possible and using an efficient solution (given that once this goes live the list of lap times will be significantly greater data wise).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Question
The manager of the team comes over to you and tells you he needs a simple process in
place to sort through the raw lap times which is currently just a list of numbers (in seconds)
in an array:
lap_times = [76.43, 77.92, 74.35, 80.12, 75.10, 76.43, 76.01, 75.35]
You need to design an algorithm (you can use a programming language or pseudo code if
you wish) to sort the lap times into ascending order.
You should consider how to do it in as few lines of code as possible and using an efficient
solution (given that once this goes live the list of lap times will be significantly greater data
wise).
Transcribed Image Text:The manager of the team comes over to you and tells you he needs a simple process in place to sort through the raw lap times which is currently just a list of numbers (in seconds) in an array: lap_times = [76.43, 77.92, 74.35, 80.12, 75.10, 76.43, 76.01, 75.35] You need to design an algorithm (you can use a programming language or pseudo code if you wish) to sort the lap times into ascending order. You should consider how to do it in as few lines of code as possible and using an efficient solution (given that once this goes live the list of lap times will be significantly greater data wise).
Expert Solution
Step 1

Answer:

We have done code in C++ programming language and sort them given element in the increasing order using the merge sort 

Algorithms:

Step1: This is totally based on the divide divide and conquer based

Step2: First find the mid index and run call the element form start to mid in the the first half and next mid +1 to last in the second half 

Step3: Also we have initialized the two left and right array to store the element  if left array element is less that the right element array then array assign to left array otherwise right array and if array element is greater that the right element array then array assign to array otherwise right array

Step4: and remaining array assign same as it 

Step5: finally print the after sorted element 

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education