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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started