Update tree2list.cpp