Random tree to binary tree mapping using WINAPI treads VS2012 project