Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The year is 430BC. Socrastes The Philosopher has a collection of important ethical questions to ponder over. Some of these questions have dependencies, i.e: Is

The year is 430BC. Socrastes The Philosopher has a collection of important ethical questions to ponder over. Some of these questions have dependencies, i.e: Is it eth- ical to consume meat? should be answered before the question What should I eat for lunch? is resolved. Socrastes may only consider one question at a time, but nev- ertheless, Socrastes is a masterful philosopher: whenever Socrastes begins thinking about a question, Socrastes is guaranteed to answer it in a few days. Socrastes will always respect the dependencies between questions in choosing which questions to think about. However, whenever Socrastes has a choice between two questions 2 to ponder, Socrastes will always choose the less important question to think about. 3 Suppose that Socrastes ranks the importance of questions on an integer scale from 1 to 10. If the number of questions is n and the number of dependencies is m, describe an algorithm which returns a possible order that Socrastes might think about the questions in O(n + m) time. Use topological Sort as a framework. Make sure the solution is completed in O(m + n) time.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

1. Were you precise in using facts and figures wherever possible?

Answered: 1 week ago