SlideShare a Scribd company logo
Edit the Person.java file so that the natural ordering or a Person is by last name in ascending
order.
Use the merge sort algorithm to implement the MergeSort sort method.
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<Person> people = new ArrayList<>();
people.add(new Person("Frank", "Denton", 73));
people.add(new Person("Mark", "Cohen", 44));
people.add(new Person("Tim", "Smith", 22));
people.add(new Person("Steve", "Denton", 16));
people.add(new Person("Andy", "Ashton", 44));
people.add(new Person("Albert", "Denton", 58));
System.out.println("Before: " + people);
List<Person> result = MergeSort.sort(people);
System.out.println("After: " + result);
}
}
import java.util.Collections;
import java.util.List;
public class MergeSort {
public static List<Person> sort(List<Person> people) {
}
}
public class Person {
private String firstName;
private String lastName;
private int age;
Person(String firstName, String lastName, int age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
}
@Override
public String toString() {
return lastName + ", " + firstName + " " + age;
}
}

More Related Content

Similar to Edit the Personjava file so that the natural ordering or a .pdf

import java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdfimport java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdf
adhityalapcare
 
Code javascript
Code javascriptCode javascript
Code javascript
Ray Ray
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdf
pratyushraj61
 
1. Section1.- Populating the list of persons on the person listing f.pdf
1. Section1.- Populating the list of persons on the person listing f.pdf1. Section1.- Populating the list of persons on the person listing f.pdf
1. Section1.- Populating the list of persons on the person listing f.pdf
aniljain719651
 
1. Section1.- Populating the list of persons on the person listing.pdf
1. Section1.- Populating the list of persons on the person listing.pdf1. Section1.- Populating the list of persons on the person listing.pdf
1. Section1.- Populating the list of persons on the person listing.pdf
aniljain719651
 
Create a text file that contains ten person objects where each object.docx
Create a text file that contains ten person objects where each object.docxCreate a text file that contains ten person objects where each object.docx
Create a text file that contains ten person objects where each object.docx
mrichard5
 
Change the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdfChange the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdf
secunderbadtirumalgi
 
Please help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdfPlease help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdf
aioils
 
Please I am trying to get this code to output in -txt file- I need you.pdf
Please I am trying to get this code to output in -txt file- I need you.pdfPlease I am trying to get this code to output in -txt file- I need you.pdf
Please I am trying to get this code to output in -txt file- I need you.pdf
asenterprisestyagi
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
Svetlin Nakov
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
arihantgiftgallery
 
About java
About javaAbout java
About javaJay Xu
 
How to fix these erros The method sortListltTgt in the.pdf
How to fix these erros The method sortListltTgt in the.pdfHow to fix these erros The method sortListltTgt in the.pdf
How to fix these erros The method sortListltTgt in the.pdf
shahidipen68
 
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfRepeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
arracollection
 
In Java- Create a Graduate class derived from Student- A graduate has.pdf
In Java- Create a Graduate class derived from Student- A graduate has.pdfIn Java- Create a Graduate class derived from Student- A graduate has.pdf
In Java- Create a Graduate class derived from Student- A graduate has.pdf
Stewart29UReesa
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
Педагошко друштво информатичара Србије
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdf
fashioncollection2
 

Similar to Edit the Personjava file so that the natural ordering or a .pdf (20)

import java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdfimport java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdf
 
Rd
RdRd
Rd
 
Code javascript
Code javascriptCode javascript
Code javascript
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdf
 
1. Section1.- Populating the list of persons on the person listing f.pdf
1. Section1.- Populating the list of persons on the person listing f.pdf1. Section1.- Populating the list of persons on the person listing f.pdf
1. Section1.- Populating the list of persons on the person listing f.pdf
 
1. Section1.- Populating the list of persons on the person listing.pdf
1. Section1.- Populating the list of persons on the person listing.pdf1. Section1.- Populating the list of persons on the person listing.pdf
1. Section1.- Populating the list of persons on the person listing.pdf
 
Create a text file that contains ten person objects where each object.docx
Create a text file that contains ten person objects where each object.docxCreate a text file that contains ten person objects where each object.docx
Create a text file that contains ten person objects where each object.docx
 
Oop lecture7
Oop lecture7Oop lecture7
Oop lecture7
 
Change the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdfChange the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdf
 
Please help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdfPlease help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdf
 
Please I am trying to get this code to output in -txt file- I need you.pdf
Please I am trying to get this code to output in -txt file- I need you.pdfPlease I am trying to get this code to output in -txt file- I need you.pdf
Please I am trying to get this code to output in -txt file- I need you.pdf
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 
About java
About javaAbout java
About java
 
How to fix these erros The method sortListltTgt in the.pdf
How to fix these erros The method sortListltTgt in the.pdfHow to fix these erros The method sortListltTgt in the.pdf
How to fix these erros The method sortListltTgt in the.pdf
 
Oop lecture9 13
Oop lecture9 13Oop lecture9 13
Oop lecture9 13
 
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfRepeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
 
In Java- Create a Graduate class derived from Student- A graduate has.pdf
In Java- Create a Graduate class derived from Student- A graduate has.pdfIn Java- Create a Graduate class derived from Student- A graduate has.pdf
In Java- Create a Graduate class derived from Student- A graduate has.pdf
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdf
 

More from aarokyaaqua

Quiz Question 1 (2 points) Which of the following is true about data.pdf
Quiz Question 1 (2 points)   Which of the following is true about data.pdfQuiz Question 1 (2 points)   Which of the following is true about data.pdf
Quiz Question 1 (2 points) Which of the following is true about data.pdf
aarokyaaqua
 
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdfRefer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
aarokyaaqua
 
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdfProblem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
aarokyaaqua
 
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdfQ3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
aarokyaaqua
 
only these choices are available Here are comparative financial state.pdf
only these choices are available  Here are comparative financial state.pdfonly these choices are available  Here are comparative financial state.pdf
only these choices are available Here are comparative financial state.pdf
aarokyaaqua
 
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdfLook up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
aarokyaaqua
 
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdfMatching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
aarokyaaqua
 
help with RR Hypothesis Experiment What is your independent variable (.pdf
help with RR Hypothesis Experiment What is your independent variable (.pdfhelp with RR Hypothesis Experiment What is your independent variable (.pdf
help with RR Hypothesis Experiment What is your independent variable (.pdf
aarokyaaqua
 
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error-   Exception in thread -main- q- Exit java-lang-.pdfHow to fix this error-   Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
aarokyaaqua
 
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdf
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdfAnatomy and Physiology 1- The epidermis is the most superficial layer.pdf
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdf
aarokyaaqua
 
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdfA- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
aarokyaaqua
 
e geyser Old Faithful in Yellowstone National Park alternates periods.pdf
e geyser Old Faithful in Yellowstone National Park alternates periods.pdfe geyser Old Faithful in Yellowstone National Park alternates periods.pdf
e geyser Old Faithful in Yellowstone National Park alternates periods.pdf
aarokyaaqua
 
A financial analyst is interested in estimating the proportion of publ.pdf
A financial analyst is interested in estimating the proportion of publ.pdfA financial analyst is interested in estimating the proportion of publ.pdf
A financial analyst is interested in estimating the proportion of publ.pdf
aarokyaaqua
 
8- In a study of helicopter usage and patient survival- among the 42-3.pdf
8- In a study of helicopter usage and patient survival- among the 42-3.pdf8- In a study of helicopter usage and patient survival- among the 42-3.pdf
8- In a study of helicopter usage and patient survival- among the 42-3.pdf
aarokyaaqua
 
Define the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdfDefine the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdf
aarokyaaqua
 
Complete the following tables- UnitAbbreviationdpsdpmcurie millicu.pdf
Complete the following tables-   UnitAbbreviationdpsdpmcurie   millicu.pdfComplete the following tables-   UnitAbbreviationdpsdpmcurie   millicu.pdf
Complete the following tables- UnitAbbreviationdpsdpmcurie millicu.pdf
aarokyaaqua
 
2- Identify in the statement of position the assets and liabilities se (1).pdf
2- Identify in the statement of position the assets and liabilities se (1).pdf2- Identify in the statement of position the assets and liabilities se (1).pdf
2- Identify in the statement of position the assets and liabilities se (1).pdf
aarokyaaqua
 
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
aarokyaaqua
 
vijay ananth has just been hired as the cio at wilshire fina.pdf
vijay ananth has just been hired as the cio at wilshire fina.pdfvijay ananth has just been hired as the cio at wilshire fina.pdf
vijay ananth has just been hired as the cio at wilshire fina.pdf
aarokyaaqua
 
Which of the Android lifecycle methods is called when the ac.pdf
Which of the Android lifecycle methods is called when the ac.pdfWhich of the Android lifecycle methods is called when the ac.pdf
Which of the Android lifecycle methods is called when the ac.pdf
aarokyaaqua
 

More from aarokyaaqua (20)

Quiz Question 1 (2 points) Which of the following is true about data.pdf
Quiz Question 1 (2 points)   Which of the following is true about data.pdfQuiz Question 1 (2 points)   Which of the following is true about data.pdf
Quiz Question 1 (2 points) Which of the following is true about data.pdf
 
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdfRefer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
Refer to Question 10 in Chapter 17 of the textbook- How is the use of.pdf
 
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdfProblem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
Problem 1- NYC Restaurants Dataset In Problem 1- you will be working w.pdf
 
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdfQ3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
Q3-2) Pick all true statements- We can easily detect metamorphic worm.pdf
 
only these choices are available Here are comparative financial state.pdf
only these choices are available  Here are comparative financial state.pdfonly these choices are available  Here are comparative financial state.pdf
only these choices are available Here are comparative financial state.pdf
 
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdfLook up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
Look up the Exxon Valdez scandal on the Internet- then answer the foll.pdf
 
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdfMatching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
Matching I A- epiphysis B- medullary cavity C- carpal G- vertebra D- a.pdf
 
help with RR Hypothesis Experiment What is your independent variable (.pdf
help with RR Hypothesis Experiment What is your independent variable (.pdfhelp with RR Hypothesis Experiment What is your independent variable (.pdf
help with RR Hypothesis Experiment What is your independent variable (.pdf
 
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error-   Exception in thread -main- q- Exit java-lang-.pdfHow to fix this error-   Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
 
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdf
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdfAnatomy and Physiology 1- The epidermis is the most superficial layer.pdf
Anatomy and Physiology 1- The epidermis is the most superficial layer.pdf
 
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdfA- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
A- Collect Bitcoin price data (monthly)- calculate monthly returns- Co.pdf
 
e geyser Old Faithful in Yellowstone National Park alternates periods.pdf
e geyser Old Faithful in Yellowstone National Park alternates periods.pdfe geyser Old Faithful in Yellowstone National Park alternates periods.pdf
e geyser Old Faithful in Yellowstone National Park alternates periods.pdf
 
A financial analyst is interested in estimating the proportion of publ.pdf
A financial analyst is interested in estimating the proportion of publ.pdfA financial analyst is interested in estimating the proportion of publ.pdf
A financial analyst is interested in estimating the proportion of publ.pdf
 
8- In a study of helicopter usage and patient survival- among the 42-3.pdf
8- In a study of helicopter usage and patient survival- among the 42-3.pdf8- In a study of helicopter usage and patient survival- among the 42-3.pdf
8- In a study of helicopter usage and patient survival- among the 42-3.pdf
 
Define the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdfDefine the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdf
 
Complete the following tables- UnitAbbreviationdpsdpmcurie millicu.pdf
Complete the following tables-   UnitAbbreviationdpsdpmcurie   millicu.pdfComplete the following tables-   UnitAbbreviationdpsdpmcurie   millicu.pdf
Complete the following tables- UnitAbbreviationdpsdpmcurie millicu.pdf
 
2- Identify in the statement of position the assets and liabilities se (1).pdf
2- Identify in the statement of position the assets and liabilities se (1).pdf2- Identify in the statement of position the assets and liabilities se (1).pdf
2- Identify in the statement of position the assets and liabilities se (1).pdf
 
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
1-3 (4 points) L is the language over the alphabet {a-b-c} given by L-.pdf
 
vijay ananth has just been hired as the cio at wilshire fina.pdf
vijay ananth has just been hired as the cio at wilshire fina.pdfvijay ananth has just been hired as the cio at wilshire fina.pdf
vijay ananth has just been hired as the cio at wilshire fina.pdf
 
Which of the Android lifecycle methods is called when the ac.pdf
Which of the Android lifecycle methods is called when the ac.pdfWhich of the Android lifecycle methods is called when the ac.pdf
Which of the Android lifecycle methods is called when the ac.pdf
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 

Edit the Personjava file so that the natural ordering or a .pdf

  • 1. Edit the Person.java file so that the natural ordering or a Person is by last name in ascending order. Use the merge sort algorithm to implement the MergeSort sort method. import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { List<Person> people = new ArrayList<>(); people.add(new Person("Frank", "Denton", 73)); people.add(new Person("Mark", "Cohen", 44)); people.add(new Person("Tim", "Smith", 22)); people.add(new Person("Steve", "Denton", 16)); people.add(new Person("Andy", "Ashton", 44)); people.add(new Person("Albert", "Denton", 58)); System.out.println("Before: " + people); List<Person> result = MergeSort.sort(people); System.out.println("After: " + result); } } import java.util.Collections; import java.util.List; public class MergeSort { public static List<Person> sort(List<Person> people) { } } public class Person { private String firstName; private String lastName; private int age; Person(String firstName, String lastName, int age) { this.firstName = firstName; this.lastName = lastName; this.age = age; } @Override public String toString() { return lastName + ", " + firstName + " " + age; } }