GithubHelp home page GithubHelp logo

friend-book's People

Contributors

girija2020 avatar nitinshrinivas avatar sambasai avatar vedant-parekh avatar victorknox avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

sambasai

friend-book's Issues

Add user.h

it should contain parameters like
name
gender
age
city
country
Fav hobby
CF rating
Organization(school/company etc)
Unique ID

Followers list struct
Following list struct

Add queue implementation

minumum required functions:
empty( ) – Returns whether the queue is empty. (bool)
front( ) function returns a reference to the first element of the queue. back() function returns a reference to the last element of the queue.
push( g) and pop( ) – push() function adds the element ‘g’ at the end of the queue. pop() function deletes the first element of the queue.

Memory allocation in register.c

printf("Enter your country: ");
newUser->country = (char *)malloc(sizeof(char *));
scanf(" %[^\n]%*c", newUser->country);

This doesn't look right. Need to review.

Add Register.c

It should create a struct and take in all the parameters of the user and assign them a USER ID (using the algo below)
It should have
A dynamic array/vector storing positive integers 1 to n

  1. pushback into the vector if a new user registers and the minheap/priority queue is empty
  2. push it into the minheap/priority queue if a user unregisters and call unregister( ) (not a part of this file)

Memory leak in unregsiter.c

We directly free the user struct when unregistering but the strings like name, organisation, etc are dynamically allocated and must be freed before freeing the struct itself to avoid memory leaks.

Unregister.c

If a user unregisters, they should be removed from everyone's friend's lists(following):
create a "followers" list which is the anti graph of "following" graph
When a user unregisters, traverse through the "followers" list, go to each user's "following" list and delete the user who unregistered.

Size of struct user_list

We are not currently updating the size of the user_list. We should do so by calling the resize_user_array function every time a new user registers. This cannot be done directly as resize_user_array depends on the variable largest_user_ID but we are not updating the value of largest_user_ID in the code currently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.