Quadwave interview question

Was asked to write logics for few sorting and searching methods