Read carefully and answer the questions that follow: Suppose we want to create a
ID: 3831140 • Letter: R
Question
Read carefully and answer the questions that follow:
Suppose we want to create an address book which contains names, phone numbers, emails, and other personal information. In the question below, give support to your answer based on the typical operations (for example, finding a person by his/her email) you might use. Explain why the algorithm and/or data structure you use gives a good tradeoff between memory use and runtime complexity. The question below could require nested data structures.
Suppose you know which of the people in you address book are friends which each other. Now suppose you take yourself out of the graph. Which algorithm(s) and data structure(s) would help you determine the number of unrelated groups of friends you have? Give reasoning for your answer.
Explanation / Answer
We can use a graph for this. The people stand for the vertices. When two people are associates, there is a link between them. So when we take our self out of the graph, the component of the graph which contained us gets broken down into several smaller components. The number of new components formed gives the number of unrelated group of associates.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.