Home > Back-end >  Data structures, consult the bosses
Data structures, consult the bosses

Time:11-13

Everyone has their own circle of friends, friends are defined as follows: if b is a friend, c is a friend of b, then c is also a friend, if is a friend of c, d, d is not a friend, the friend relationship should be passed by one person; Please design a social network diagram, and then according to the design of social network diagram, write a program, complete the following functions:
(1) social network diagram contains at least 50 people, stored in a file way,
(2) respectively by adjacency matrix and adjacency list storage structure means social network diagram, and output the adjacency matrix and adjacency table,
(3), respectively, in the above two kinds of storage mode, find out everyone's friend and output,
(4) the relationship between social network diagram to add some new people and friends, to output everyone
Friend,
(5) the social network graph are deleted after some people, to find out everyone's friend,
(6) to identify each person's potential friends, hidden friends are defined as follows:
If a and b are friends, all is a friend is a friend of b's hidden friend,
The hidden relationships can be passed by the two,
  • Related