Question: Use c + + to write code for these two functions. int Related ( int id _ 1 , int id _ 2 ) const:
"Use c to write code for these two functions.
int Relatedint id int id const: Returns the length of the shortest path between node id and node idie shortest length between person and person if such path exists; otherwise, return
int Related int id int id const std::string& relationship: Returns the length of the shortest path between node with id and node with id where all edges in XQ the path are relationship ie shortest length between person and person for the only given relationship if such path exists; otherwise, return
We have a vector relation that store the relationship between two people. And a map graph that stores vertices and adjacency list."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
