Starting from:

$30

CENG140– Homework 2 Solved

In this homework assignment, you will be implementing a mini realistic social-media application called CengBook, in C programming language. You are provided with stub code and some utility services in the homework bundle. The stub code contains some parts that are already implemented for you, and some functions that you should implement yourselves (marked with the comment TODO in the CengBook.c file). The Linux executable (64 bit) of my sample implementation is also provided in the homework bundle; you can run it to try various inputs and see how your implementation should respond (try to match the output syntax exactly).

 

Part One – CengBook (75 points)
 

Your implementation will help an administrator to register, delete, find, connect, disconnect, list, sort and visualize the users on CengBook, as well as to check for the shortest paths between users. For this purpose, you will just need to implement the parts marked with the comment TODO in CengBook.c file. Note that you need to study and fully understand the queue data structure and also the utility services for this part, because you will need to make use of those services while implementing the missing parts in the CengBook.c file.

 

Part Two – Sorting and Searching Basics (20 points)
 

Write a report to explain how the sortBook and the shortestPath functions (implemented in Utilities.c file) work, in details. In your report, make sure to include and refer to some figures that represent the variables / data structures used in those functions, and also briefly trace each function on a simple / short example.

 

Part Three – Time Complexity Analysis (5 points)
 

How many (and what) operations are required in order to delete a user from CengBook? List and count all of the operations/tasks (try to come up with a parametric summation). Hint: Make sure to think thoroughly about all of the required tasks like removing this user from his/her followers’ friend lists, decrementing follower counts of this user’s friends, removing this user’s pointer from the list of pointers kept in the book, deallocating this user’s memory storage, etc.

Page 1 of 2

More products