Dynamic Spectrum Allocation and Sharing in Cognitive Cooperative Networks