GlobalLogic interview question

Name and elaborate algorithm complexities