For discrete sets coded by the Freeman chain describing their contour, several linear algorithms have been designed for determining their shape properties. Most of them are based on the assumption that the boundary word forms a closed and non-intersecting discrete curve. In this article, we provide a linear time and space algorithm for deciding whether a path on a square lattice intersects itself. forms the contour of a discrete figure. This is achieved by adding a radix tree structure over a quadtree, where nodes represents grid points, enriched with neighborhood links that are essential for obtaining linearity. Due to its simplicity, this algorithm has many applications and, as an illustrative example, we use it for determining efficiently a solution to the more general problem of multiple paths intersection.