Sharp Jackson and Bernstein inequalities for N-term approximation in sequence spaces with applications