Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Question: /** * socialRank * * for each vertex v, determine how many vertices have degree higher than v * how many people are

Java Question:

/** * socialRank * * for each vertex v, determine how many vertices have degree higher than v * "how many people are more popular than v?" * store the answer in socialRank[v] */ private void determineSocialRank(Graph G) { for (int v= 0; v < G.V(); v++) { socialRank[v]=-1; // ToDo 3 fix this } }

More information that might be useful:

public class SocialCircles { private int numberOfTrios; // the results of the computations are stored private int[] indirectPopularity; // in these instance variables. private int maxBalanceFactor; // the values of the variables may be accessed by clients using private int numberOfMostUnbalancedFriendships; // the corresponding 'accessor' functions below. private int [] socialRank;

// accessor functions public int getIndirectPopularity(int v) { // getIndirectPopularity of vertex v return indirectPopularity[v]; } public int getNumberOfTrios() { return numberOfTrios; } public int getMaxBalanceFactor() { return maxBalanceFactor; } public int getNumberOfMostUnBlanancedFriendships() { return numberOfMostUnbalancedFriendships; } public int getSocialRank(int v) { // get getSocialRank of vertex v return socialRank[v]; }

// ---end accessors

/** * degree * * Suggestion. copy the degree function (or see if you can write it from scratch) from the textbook. * you may find it a useful utility function for your functions */ public static int degree(Graph G, int v) { int degree = 0; for (int w : G.adj(v)) degree++; return degree; }

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

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

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

=+(34.18) lim f XdP=afXdP JA for each integrable X (measurable } ).

Answered: 1 week ago

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago