Question 1
Fill the given blanks to complete the Neighbor-Joining algorithm.
NEIGHBORJOINING(D, n) if n = 2 T ← the tree consisting of a single edge of length D_{1,2} return T D* ← the neighbor-joining matrix constructed from the distance matrix D find elements i and j such that D*_{i,j} is a minimum non-diagonal element of D* Δ ← (TOTALDISTANCE_D(i) − TOTALDISTANCE_D(j)) / (n − 2) limbLength_i ← [ I ] limbLength_j ← [ II ] add a new row/column m to D so that D_{k,m} = D_{m,k} = 1/2 (D_{k,i} + D_{k,j} − D_{i,j}) for any k remove rows i and j from D remove columns i and j from D T ← NEIGHBORJOINING(D, n − 1) add two new limbs (connecting node m with leaves i and j) to the tree T assign length limbLength_i to LIMB(i) assign length limbLength_j to LIMB(j) return T