Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Goal: • Write a list of people ordered so that no one appears in the list before

ID: 3806592 • Letter: G

Question

Goal:

• Write a list of people ordered so that no one appears in the list before anyone he or she is less smart than.

Problem:

• Provide a RESTful service which accepts as a POST of JSON a list relationships [A, B] such that A is smarter than B.

• Return in JSON the list sorted by smartness, with the smartest person first.

• Example input:

(“Einstein is smarter than Feynmann”, “Feynmann is smarter than Gell-Mann”, etc.)

{ “inList” : [ { “smarter” : [ “Einstein”, “Feynmann” ] }, { “smarter” : [ “Feynmann”, “Gell-Mann” ] }, { “smarter” : [ “Gell-Mann”, “Thorne” ] }, { “smarter” : [ “Einstein”, “Lorentz” ] }, { “smarter” : [ “Lorentz”, “Planck” ] }, { “smarter” : [ “Hilbert”, “Noether” ] }, { “smarter” : [ “Poincare ”, “Noether” ] } ] }

Example output:

{ “outList” : [ “Einstein”, “Feynmann”, “Gell-Mann”, “Thorne”, “Lorentz”, “Planck”, “Hilbert”, “Poincare”, “Noether” ] }

Explanation / Answer

Hello,

In the question itself it has been mentioned what is the input and how the output has to come .

If this particul has to be coded in some language please specify.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote