Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python qs Information = [[James,Dancer,9000,9], [Nina,Singer,4000,2], [Samantha,Engineer,5000,5], [Tom,Teacher,2000,3], [Adam,Teacher,4000,5]] The lst position in every sublist : Name The 2nd position in every sublist : Occupation
Python qs
Information = [[James,Dancer,9000,9],
[Nina,Singer,4000,2],
[Samantha,Engineer,5000,5],
[Tom,Teacher,2000,3],
[Adam,Teacher,4000,5]]
The lst position in every sublist : Name
The 2nd position in every sublist : Occupation
The 3rd position in every sublist : expected salary
The 4th position in every sublist : years of experience
Design an algorithm that sort the information by Name alphabetically(A-Z), by expected salary (Low - High) and by the years of experience(High to Low).
You can sort one aspect at a time but your algorithm must support all 3 sorting aspects.
Please use mergesort as it has the lowest time complexity compared to other sorting algorithms.
Results of Sort by Expected Salary (Low to High):
[[Tom,Teacher,2000,3],
[Nina,Singer,4000,2],
[Adam,Teacher,4000,5],
[Samantha,Engineer,5000,5],
[James,Dancer,9000,9]]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started