Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implementing Family Tree From Scratch in C++. ( GeekTrust problem)

NotificationsYou must be signed in to change notification settings

niteshkumartiwari/Family-Tree-Geektrust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please read this before running the familyTree.cpp.

  1. We are using familyData.txt to add the basic family tree.
  2. User can add there queries in the userData.txt.
  3. In the Node, we have used heightOfNode that can be used to find therelation between two persons i.e. if height is 1 then will be siblings or cousins(but notused in the code since it was not required).
  4. We have added King Shan as 'King-Shan' and Queen Anga as 'Queen-Anga'. To make the parsing easywhile using ' ' as delimiter. PLEASE KEEP THIS IN MIND WHILE ADDING CHILD TO QUEEN ANGA. Rather thanadding it as ADD_CHILD Queen Anga XYZ PQR => ADD_CHILD Queen-Anga XYZ PQR

#Assumptions:

  1. Mother can only add the child.
  2. Marriage is done before having a baby(since linkage is done after marriage in the code).
  3. To find Paternal/Maternal relation, it is necessary to have Grand-Parent !!!
  4. By default we are only considering the cross-marriage culture for ease.
  5. We are printing the results in left to right occurence in the tree.(We can simply sort the result, to print in chronological fashion)

#Templates to Add members in familyTree:

  1. Add Child:

    ADD_CHILD A B CA:Mother-Name (that is already in the familyTree)B:Child-Name (to be added as a new Node)C:Child-Gender

  2. Add Spouse:

    MAKE_COUPLE A BA:PersonA (that is already there in the familyTree)B:PersonB (the new node to be added as spouse in the familyTree)

#Template to Query for relationship:

GET_RELATIONSHIP A BA:PersonName (already in familyTree otherwise it will show PERSON_NOT_FOUND)B:It can take below parameter for now -1. Paternal-Uncle2. Maternal-Uncle3. Paternal-Aunt4. Maternal-Aunt5. Sister-In-Law6. Brother-In-Law7. Son8. Daughter9. Siblings


[8]ページ先頭

©2009-2025 Movatter.jp