= = = = * = = = = = = figure decision tree for the worked turnpike reconstruction example bool turnpikevector xdistset dint deletemaxxn ) deletemaxxn )ifxn xn removexn xn )return placexdn )else return falsefigure turnpike reconstruction algorithmdriver routine (pseudocodepass the same arguments plus the boundaries left and rightxleft xright are the coordinates of points that we are trying to place if is empty (or left right)then solution has been foundand we can return otherwisewe first try to place xright dmax if all the appropriate distances are present (in the correct quantity)then we tentatively place this pointremove these distancesand try to fill from left to right if the distances are not presentor the attempt to fill left to right failsthen we try setting xleft xn dmax using similar strategy if this does not workthen there is no solutionotherwise solution has been foundand this information is eventually passed back to turnpike by the return statement and array