sorting and searching in c