Time: n^2 Space: n