connects 2 nodes (if they are not already connected), and updates the tree structure arising from the merge.
connects 2 nodes (if they are not already connected), and updates the tree structure arising from the merge.returns the change in the number of trees available in the heap. For example, if two nodes which are part of two existing trees are connected, their respective trees will be merged and thus the number of trees will be diminished by 1, thus the return value is -1.