Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the LinkedIn solution that allows people to connect on a social media platform for employment purposes. Every user on LinkedIn can establish one or

Consider the LinkedIn solution that allows people to connect on a social media platform for employment purposes. Every user on LinkedIn can establish one or more connections with other users on the same platform. In addition to the connections, assume that LinkedIn also tracks and saves the employer company of each user.
Consider the following example.
The above example shows that Khaled works for Roya and is connected to 44 other LinkedIn users: Ahmad, Sara, Sultan, and Firas.
Write a function that allows a user to discover the closest company to him//her.. The function targets a specific input user and prints the closest company to the user based on his//her connections other than his//her company. The closest is defined by having the highest number of connections from 11st and 22nd-degree connections. For instance, for Amer from Tamatem, 11st degree has STS(1)(1) and 22nd degree STS(1)(1) and Roya(1),(1), so accordingly, STS is the answer with a total of 22 connections.
Input
N for the number of users,
C for the number of connections between these users
An array for the names of the users with names[0][0] as the name of the first user and so on..
An array for the companies with companies[0][0] as the company of the first user and so on..
An array of integers for the From values of the connections, assuming 00-based arrays
An array of integers for the To values of the connections, assuming 00-based arrays
A user name as a string
Output
Your function should print the closest company for the given user name
In case of having two or more companies have the same level of closeness, print all of them in ascending order, one line each.
In case the user is not connected with anyone, print the result "Not Connected".
Note:
The program will be automatically tested by calling your Closest((int N,, int C,, string names[],[], string companies[],[],int from[],[], int to[],[], string name)) function. You are not allowed to change the signature of this function but you can expand your file and functions//classes as needed. Assume that unique names are used such as emailaddresses..

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Heres a possible implementation in C include include include include using namespace std void Closes... 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

Business Ethics A Stakeholder And Issues Management Approach

Authors: Joseph W. Weiss

7th Edition

1523091541, 978-1523091546

More Books

Students also viewed these Programming questions

Question

=+b) What would the data values in such an indicator variable be?

Answered: 1 week ago

Question

In Exercises 1558, find each product. (9 - 5x) 2

Answered: 1 week ago