Question: In this assignment, you will develop a C program of micro-version of Facebook using HASH TABLES and Linked Lists. Specifically, your program will accept from

In this assignment, you will develop a C program of micro-version of Facebook using HASH TABLES and Linked Lists. Specifically, your program will accept from input a sequence of commands of the following forms, one command to a line, such as:

P name Create a person record of the specified first name. You may assume that no two people have the same first name.

F name1 name2 Record that the two specified people are friends.

U name1 name2 Record that the two specified people are no longer friends.

L name Print out the friends of the specified person.

Q name1 name2 Check whether the two people are friends. If so, print Yes; if not, print No

X terminate the program.

For instance, this is one possible input and output:

Input Output

P Sam

P Liza

P Mark

P Amy

F Liza Amy

F Liza Mark

F Amy Sam

L Amy Liza Sam

L Sam Amy

U Liza Amy

L Amy Sam

Q Liza Mark Yes

X

Try to make the program as efficient as possible.

You dont need to write the data into a file. All the entries should be saved in memory.

Your program should compile using gcc on a unix/lunix machine. Using a makefile is encouraged but not required. You can also provide a readme file if needed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!