Family Tree using Generalized Linked List

Hello and Welcome. In the previous blog post, we saw how we can store polynomials using a linked list. We also saw various types of Linked Lists and studied in detail about the Generalized Linked Lists(GLLs).
This is the final blog of this blog series. In this blog, we will go a step further and learn how to use GLLs to implement a family tree. This will enable us to store hierarchical data. Let's start with the basics of a family tree.

What is Family Tree?
family tree, or pedigree chart, is a chart representing family relationships in a conventional tree structure.

A simple family tree.


The algorithm for implementing the family tree is as follows:

-        Create a struct node with: -
·       name pointer
·       spouse pointer
·       pointer to sibling node,
·       pointer to the child node,

-        In this node we add our data for each family member

-        Then to display the data stored in GLL Family Tree:

-        Function: traversal(base node)

·       if base==NULL exit()            //base case handling
·       create a queue
·       enqueue base node
·       while q is not empty
                  a = dequeue
            Print name and spouse of a
            Enqueue all siblings of a
            Print name of siblings
            Enqueue children of a
            Print names of children


The results which were obtained after successful implementation have been shown in the figure below.

 Results

Apart from implementing a family tree, there are a lot of other applications of linked lists in the real world like:

  1. Image viewer – Previous and next images are linked, hence it can be accessed by next and previous button.
  2. Previous and next page in the web browser – We can access previous and next URLs searched in a web browser by pressing back and next button since, they are linked as a linked list.
  3. Music Player – Songs in music players are linked to the previous and next song. you can play songs either from the starting or end of the list.

After implementing the project, we realized that the comprehensive database of a group of people can be stored by increasing the number of nodes in the linked list. This method enables the programmer to easily access data.

A family tree was implemented using the concepts of Generalised Linked List. The major features such as a parent, child, spouse, and siblings were conserved. This project is done in the C++ programming language with the object-oriented nature of programming. 

Thus, we successfully completed the project on Family Tree using the Generalized Linked List in Object-oriented Programming.


References-

[2] GeeksforGeeks - https://www.geeksforgeeks.org/

The links for the presentation, project report and project video have been attached. Do visit them:







Topic 1: Introduction
Chinmay Pathak, K, 56, 1710109
              Video Link - https://youtu.be/zytb7yLPuoQ

Topic 2:  What is GLL?
Saransh Kulkarni, K, 43, 1710532
              Video Link - https://youtu.be/bgAtNHkN1j8

Topic 3:  Algorithm and Results
Aadhiraj More, K, 51, 1710501

Topic 4:  Application of Linked Lists
Sarvesh Patki, K, 72, 1710269
              Video Link - https://youtu.be/QFXnrx0hYoQ

Seminar 2 Title - Exception Handling in C++
Link - https://prezi.com/view/qohhOmSshNek8sgVFiK2/

Blogger Handles of Teammates -






I hope you had a great time learning about various programming concepts. It has been a great journey so far. Finally, on behalf of my team members, I would like to thank our teacher, Prof. Dr. Swati Shilaskar ma'am for guiding us throughout the process of writing blogs and implementing the course project. Looking forward to working on similar and more interesting projects. Thank you.
Sarvesh Patki
K - 72

Comments

Post a Comment

Popular posts from this blog

Representation of polynomials using Generalized Linked List