In this paper, we consider a way to deploy a wireless sensor network under the dynamic spectrum sharing. The dynamic spectrum sharing technique can help a sensor network overcome the shortage of radio resources because of getting crowded unlicensed ISM bands commonly used by it. For the purpose of this, we analyze the aggregate interference to a primary network from the sensor network as a secondary network. Base on the analysis, we propose a cost-efficient deployment algorithm. The proposed algorithm consists of the power control framework to avoid harmful interference and the inhomogeneous deployment strategy to guarantee k-coverage and k-connectivity with the least number of additional sensor nodes reducing the deployment cost. Through the numerical analysis to verify the performance of the proposed algorithm, we show the power control framework makes it possible that the sensor network is deployed with a primary network even under more restricted conditions, and the inhomogeneous deployment strategy saves the number of additional sensor nodes needed to cover a given sensing area by about 20%.