Various sorting and searching algorithms