Data Structures and Algorithms, CS146
This programming assignment is for individual work only. You are not allowed to use someone’s code or copy from internet, except for Web Crawler code provided. Code plagiarism checker tools (Jplag, MOSS, etc.) will be used to check the similarity of codes. You may be asked to demo and explain your code to the instructor or to the class. Cheating will not be tolerated and will be reported to University. Please check on the University Policies in the syllabus.
Read this instruction carefully before your design and implementation of your work.
Problem Statements
Facebook is a very popular web based social media application. In this programming assignment,
you will use Hash Table and Hashing Functions to design and implement a micro-version of
Facebook.
Specifically, your program must provide options (or GUI) for users to choose the following
operations:
1. Create a person record of the specified name. (You may assume that no two people have the
same name.)
2. Record a person as a new friend. (Make a friend.)
3. Remove a person from the friend list. (Unfriend)
4. Search a person’s name to list his/her friend list. (he/she may or may not be your friend.)
5. Enter two person’s names to check whether the two people are friends. (Print “Yes” or “No”)
Functional Requirements
1. (-20%) For this programming assignment, your job is to design and implement a micro
version of Facebook using Hash Table. The Hash table MUST contain minimum 10 slots
and maximum 15 slots. At least 50 distinct users must be stored in the table by using a
hash function. Other size of table and users will be considered violating functional
requirements and 0 point will be given.
2. (-30%) The following 50 distinct popular names must be used to test your program. You may
do your own way to make friendships for these people. (Remember that you have to convert
a name to a natural number for hashing purpose)