Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

There are n people. The entry K[i][j] of a rectangular n by n array K is set to 1 when person i knows person j

There are n people. The entry K[i][j] of a rectangular n by n array K is set to 1 when person i knows person j and is set to 0 otherwise. Assume that K[i][i] = 1 for every i, since everyone knows themselves. A celebrity is a person who is known by everyone and does not know anyone besides himself/herself. For example, in the left diagram below person 3 is a celebrity. This corresponds to K = { {1, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 1, 0}, {1, 0, 1, 1} }. There is no celebrity in the right diagram. This corresponds to K = { {1, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 1, 0}, {1, 0, 1, 1} }. Write and test a method that takes K as a parameter and determines which row is a celebrity or concludes that there is none.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago