c# - Find dead nodes from Parent Child Node collection -
i have collection of custom node has parent child relation. each node can composite type (that has other child in it) or simple type (leaf level node) i want write function give me list of dead nodes. example here node collection based on above case, p2, p3, p8, p9, p10, p6, c1 dead nodes (since down hierarchy don't have simple node in them) i need function as private list<nodeentity> getdeadnodes(list<nodeentity> originallist) here function has original list private list<nodeentity> getoriginallist() { var list = new list<nodeentity>() { new nodeentity() {code = "p1", parentcode = "001", type = nodetype.composite}, new nodeentity() {code = "c1", parentcode = "001", type = nodetype.composite}, new nodeentity() {code = "p2", parentcode = "p1", type = nodetype.composite}, new nodeentity() {code = "p3", parentcode = "p2", ty...