Tree to doubly linked list, largest submatrix sum