Question: 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

1 Expert Approved Answer
Step: 1 Unlock

Heres a possible implementation in C include include include include using namespace std void Closes... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!