Linear equations are generally expressed in the form y = mx + b - the highest exponent of x is one.
Quadratics are expressed as y = ax^2 + bx + c - the highest exponent of x is two.
Any equation with an exponent of x higher than two is neither linear nor quadratic, but instead cubic or higher. Therefore we can simply sort these equations by the highest exponent of x present after simplifying.