You are given a collection of nodes, each represented as a JSON object (or similar structure) containing: a node ID, a parent ID (null/absent for root nodes), and a level/depth field indicating which level of the tree the node sits on. Your tasks: (1) Identify all root nodes (nodes whose…