Saturday, April 18, 2020

DOCUMENTATION

Course project Title:
    
Implementation of Family tree Using Generalized Link List


Description: 

  In this project we have created FAMILY TREE by using Generalized link list.Also we have implemented different functions to operate the Family Tree such as to add new family members,finding the relationship between two members,searching operation,updating information of family tree,deletion operation,display operation .etc

Link For Project Report: Project Report


Topic 1: Introduction and Adding Family tree

Presenters info:
Name: Akshay Ashok Bharati
Div:TY-L
Roll no:07
video link: https://drive.google.com/open?id=1ahbFCzP_w9dA9gu51i-2AhNsq43phD9M


Topic 2: Finding Relationship between two members

Presenters info:
Name: Dayanand Haral
Div:TY-L
Roll no:24
video link: https://drive.google.com/file/d/1SBeNwVyrm1implE7Il9Bz1eGoMq6l8sP/view?usp=drivesdk



Topic 3: Searching member in Family tree
Presenters info:
Name: Aniket Kapale
Div:TY-L
Roll no:33
video link: https://drive.google.com/a/vit.edu/file/d/1K_q_LMvGHqdab7p9k2cQdPDqTyMS3Z3w/view?usp=drivesdk

Topic 4: Output Explanation
Presenters info:
Name: Atharv Joshi
Div:TY-L
Roll no:31
video link: https://drive.google.com/file/d/1Wv23HAQl6vKyLimVMX0rn6BiJrzbOOmr/view?usp=sharing


Thank you!!!

Thursday, April 16, 2020

OPERATIONS ON FAMILY TREE

Now,when we complete the adding of members in Family tree,We require some operations such as:

1)Checking whether the person present in Family tree or not.


2)Finding the relationships between two members.


3)Display of Family tree


4)Destroying a Family tree 


5)Connecting Two Family Trees


6)Updating a Family Tree

etc.


We will implement a user driven Switch case,and according to the input given by user we will call that method.



 cout<<"\n\n\n\tFamily tree no = "<<n<<"\n\n\t
1. Add new person\n\t
2. Find relationship b/w two persons\n\t
3. Search\n\t
4. Destroy\n\t
5. Display\n\t
6. Change family tree\n\t
7. Connect two family trees\n\t
8. Exit\n\n\tEnter your choice = ";
        cin>>opt;
        cout<<endl;

        switch(opt)
        {

        default:
                cout<<"Invalid input";
                break;

        case 1:
                T[n].addNew();
                break;

        case 2:
                T[n].find();
                break;

        case 3:
                cout<<"Enter name of person to search: ";
                cin>>name;
                T[n].show(T[n].search(name));
                break;

        case 4:
                T[n].destroy(T[n].start);
                cout<<"Tree "<<n<<" has been destroyed sucessfully";
                break;

        case 5:
                T[n].display(T[n].start);
                break;

        case 6:
                cout<<"Enter family tree number: ";
                cin>>n;
                break;

        case 7:
               cout<<"Merge __ to __ \n";
               cin>>n2>>n1;
               connect(&T[n1],&T[n2]);
               break;

        case 8:
            return 0;

        }
        cout<<"\n\nPress any key to continue.....";
        cin>>c;
    }


This is just a overview of How the user will interact to call the methods.
In next Post We will provide you the total code for implementing each operation.

TAKING THE FAMILY TREE DATA FROM USER

Now, I think you are quiet comfortable with basics of link list.lets  start the actual coding part of our project.
As we are designing a Family tree,We need  Following two things:

1)Data of family tree
2)Functions that will process different operations on Family tree

now lets understand about how we are going to take Family tree from user.

1)We can take information for each person in family such as name,age,Gender,etc.
2)We need a two pointers for every person that will point sibling and child.

The way in which we are going to store the data is shown below:

For the above implementation we need a structure which will consist of name,age ,gender and we will require two pointers to point sibling and child.


struct node
{
    char name[50];
    short int age,x;    // x - height of node
    bool g;             // g- gender
    node* fc;           // Pointer to first child
    node* ns;           // Pointer to next sibling

    node();
    void getData();
};

void node::getData()
{
    char ch;
    cout<<"\nName of the Person: ";
    cin>>name;
    cout<<"Age of "<<name<<": ";
    cin>>age;
    cout<<name<<" is (m/f): ";
    cin>>ch;
    if(ch=='m')
        g=1;
}

Now,after taking the personal information,we need to make connection of this node in family according to relationship..
So we will ask the user to enter the relation of this person with specific person in family tree and then we will connect these two node depending on the relationship.i.e sibling or child.


Given below is  addNew() method which will add a new person according to relation with previous members in Family tree.



void familyTree::addNew()
{
    node* temp = new node;
    temp->getData();

    if(start == NULL)
    {
        start = temp;
        temp->x=0;
    }

    else
    {
        cout<<"\nEnter any relation's name: ";
        char name[50];
        cin>>name;
        cout<<"\n1. Child\n2. Sibiling\n\n"<< temp->name <<" is ____ to "<<name<<" : ";
        int opt;
        cin>>opt;
        switch(opt)
        {
            case 1:
                    addChild(search(name),temp);
                    break;
            case 2:
                    addSib(search(name),temp);
                    break;

        }
    }
    cout<<"\nPerson sucessfully added.\n";
}




DOCUMENTATION

Course project Title:      Implementation of Family tree Using Generalized Link List Description:    In this project we have create...