C tree algorithm

Still crashing

Signed-off-by: Alan Rodriguez <alanrodriguezromero@gmail.com>