clearly this implementation is not general purposebecause it is inadequate for such important operations as finding the leftmost child or the right sibling for node thusit may seem to be poor idea to implement general tree in this way howeverthe parent pointer implementation stores precisely the information required to answer the followinguseful question"given two nodesare they in the same tree?to answer the questionwe need only follow the series of parent pointers from each node to its respective root if both nodes reach the same rootthen they must be in the same tree if the roots are differentthen the two nodes are not in the same tree the process of finding the ultimate root for given node we will call find the parent pointer representation is most often used to maintain collection of disjoint sets two disjoint sets share no members in common (their intersection is emptya collection of disjoint sets partitions some objects such that every object is in exactly one of the disjoint sets there are two basic operations that we wish to support( determine if two objects are in the same setand ( merge two sets together because two merged sets are unitedthe merging operation is usually called union and the whole process of determining if two objects are in the same set and then merging the sets goes by the name "union/find to implement union/findwe represent each disjoint set with separate general tree two objects are in the same disjoint set if they are in the same tree every node of the tree (except for the roothas precisely one parent thuseach node requires the same space to represent it the collection of objects is typically stored in an arraywhere each element of the array corresponds to one objectand each element stores the object' value the objects also correspond to nodes in the various disjoint trees (one tree for each disjoint set)so we also store the parent value with each object in the array those nodes that are the roots of their respective trees store an appropriate indicator note that this representation means that single array is being used to implement collection of trees this makes it easy to merge trees together with union operations figure shows the parent pointer implementation for the general treecalled parptrtree this class is greatly simplified from the declarations of figure because we need only subset of the general tree operations instead of implementing separate node classparptrtree simply stores an array where each array element corresponds to node of the tree each position of the array stores the value for node and the array position for the parent of node class parptrtree is given two new functionsdiffer and union function differ checks if two