Consider the following algorithm someAlgo that takes an undirected graph \( G \) as input.
someAlgo(G) Let \( v \) be any vertex in \( G \).
1. Run BFS on \( G \) starting at \( v \). Let \( u \) be a vertex in \( G \) at maximum distance from \( v \) as given by the BFS.
2. Run BFS on \( G \) again with \( u \) as the starting vertex. Let \( z \) be the vertex at maximum distance from \( u \) as given by the BFS. 3. Output the distance between \( u \) and \( z \) in \( G \).
The output of tt{someAlgo(T)} for the tree shown in the given figure is ____________ . (Answer in integer)

The algorithm tt{someAlgo} effectively finds the diameter of the tree \( T \), which is the longest shortest path between any two nodes in the tree. Step 1: Run BFS from any arbitrary node \( v \) - Select an arbitrary node and perform a BFS to find the farthest node \( u \).
Step 2: Run BFS from \( u \) to find the farthest node \( z \) - Perform another BFS starting from \( u \) to determine the farthest node \( z \).
Step 3: Compute the distance between \( u \) and \( z \) - The distance obtained in this second BFS represents the tree's diameter. From the given tree diagram, the longest shortest path (diameter) is found to be \( 6 \).
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:
P: Unsorted doubly linked list with pointers to the head node and tail node of the list.
Q: Min-heap implemented using an array.
R: Binary Search Tree.
Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size \( n \) of these data structures?