A simple method in Java

This problem has to be done in 20hrs from now .so Toronto time Oct 12, 2015 at 10pm it will be expire.

Social Network

This problem involves abstractions such as graph algorithms: You are maintaining a social network site, and your task is to verify whether a site member is allowed to access the page of another site member. The members have defined their friendship relations, and they allow different types of access, some only to direct friends, some to friends of friends (and friends of friends of friends, and so on), which are called indirect friends.

Input Description

The input starts with a positive integer n, which is the number of members of the site. This line is followed by a line containing the string "Friendships:", followed by a list of name pairs, each describing a friendship relation. The list of friendships is followed by an empty line, and a line containing the string "Queries:", which is followed by queries, each containing two member names A and B, for which you need to check whether A has permissions to access the B's information. Member names do not contain white-space characters.

Output Description

For each query in the input, where A and B are the names in the query, produce one line of output, which can be one of the following three lines:

direct access

indirect access

no access allowed

depending on whether A is a direct friend of B, indirect friend, or neither of those.

Sample Input



Alice Bob

Bob Charlie

Charlie Dong

Dong Eman

Eman Bob

Sidney Henrik

Henrik Alex


Bob Eman

Sidney Alex

Alex Charlie

Sample Output:

direct access

indirect access

no access allowed

Taidot: Java

Näytä lisää: types of algorithms, two string problem, the string problem, string algorithms, simple algorithms in c, problem graph, list of graph types, line algorithms, graph with java, graph problem, graph on java, graph java, graph in java, graph algorithms in java, graph algorithms in c, graph algorithms c, different types of algorithms, charlie's produce, algorithms graph, algorithms defined, method simple application java netbeans, simple excel type online database need created asap, simple excel type online database need, java sip simple, java code simple messenger

Tietoa työnantajasta:
( 2 arvostelua ) Toronto, Canada

Projektin tunnus: #8665569

Myönnetty käyttäjälle:


Hello, I am a teaching assistant on the Algorithms at a local college. I already have Dijkstra algorithm implementation and I can have this done for you in 30 minutes. Please contact me with any questions or deta Lisää

$15 CAD 0 päivässä
(1 arvostelu)

2 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


hello, I am expert in java. i can start this work from today onward. so please open your chat box and let me know.

$25 CAD 1 päivässä
(0 arvostelua)

Hi, Greetings of the day and thanks for sharing these details and allowing me to bid on this assignment. yes we have similar experience and can deliver u as u have mentioned in your requirements. we already have Lisää

$25 CAD 1 päivässä
(0 arvostelua)

A proposal has not yet been provided

$28 CAD 1 päivässä
(0 arvostelua)