PSort:check empty array ; PSearch:use callable, priorityQ