In C++ Create a program that uses Selection Sort and Insertion Sort for the National Football League...

80.2K

Verified Solution

Question

Programming

In C++

Create a program that uses Selection Sort andInsertion Sort for the National Football League list of currentplayers. It's going to be a big list(over 1000 names). Pleaseidentify, in comments, which part of the code is for the SelectionSort and which part of the code is for Insertion Sort. Itmust have both.

Inputting data from a text file named \"Players.txt\"

Only want the name of the player(first name then last name),their team name, and position they play.

Example is:

NameTeamPosition
Patrick MahomesChiefsQuarterback
Julio JonesFalconsWide Receiver
Fletcher CoxEaglesDefensive Tackle

Structure of the input file is:

Patrick Mahomes, Chiefs, Quarterback

Julio Jones, Falcons, Wide Receiver

Fletcher Cox, Eagles, Defensive Tackle

Output both lists separately(please indicate which lists goeswith which sorting method) to a text file along with how long ittook to go through the Selection Sort and Insertion Sort and howmany iterations it took for each.

Thanks.

If you can't do this then can you please let someone else.

Answer & Explanation Solved by verified expert
4.4 Ratings (806 Votes)
Both sort will take n iterations so you meant number ofcomparisons for both sorting algorithmscodr with commentsinclude using namespace stdstruct Player string    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students