Optimal Resilient Sorting and Searching in the presence of Memory Faults