Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Each user in FaceBooo is defined as a key-value pair where the key is the unique id of the user and the value is an

Each user in FaceBooo is defined as a key-value pair where the key is the unique id of the user and the value is an encrypted pointer to an object that contains data (the wall content) of the user. Most operations in the network involve updating the wall (e.g., a user adds a new picture). Sean knows how to implement these operations efficiently. He also knows how to handle basic operations on keys like become-friend(k1,k2). As Facebooo grows by size, Sean needs to handle a larger variety of queries. For that, he asks your help (after all he is not a computer scientist). The new operations are are-connected(k1,k2) which return true iff the two users are connected (if k1 is a friend of a friend of a friend ... of a friend of k2). FaceBooo also needs to support most-popular-connected(k1) query which returns the user with the maximum number of friends among all users connected to k1. Describe how you support are-connected(k1,k2) and most-popular-connected(k1) operations efficiently. In order to do this, you might need to make changes to your data structure when a user joins the network (join(k1)) as well as when two users become friends (become-friend(k1,k2)). To get the full mark, you need to describe the data as stored in your data structure, and how it is updated/queried in the above four queries. For the sake of simplicity, you can assume users cannot leave the network and cannot unfriend each other in FaceBooo.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

More Books

Students also viewed these Databases questions

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago