Hierarchy-program/README.md at master · surajitgithub/Hierarchy-program · GitHub
Skip to content

Latest commit

 

History

History
5 lines (4 loc) · 435 Bytes

File metadata and controls

5 lines (4 loc) · 435 Bytes

Hierarchy-program

Engineer will have first child as engineer, second as doctor, doc will have first child doc , second as engineer, generation starts with engineer and doubles every generation.. because all will have 2 kids so 1st gen = E 2nd gen = ED 3rd gen = EDDE 4TH gen = EDDEDEED and so on … given generation number and child number , say if that child is engg or doc

O(n) solution provided O(1) solution yet to be done