big o complexity for lab 7