Best proximity pair theorems for noncyclic mappings in Banach and metric spaces