Cognitive radio networks allow unlicensed users to access licensed spectrum opportunistically without disrupting primary user (PU) communication. Developing a distributed implementation that can fully utilize the spectrum opportunities for secondary users (SUs) has so far remained elusive. Although throughput optimal algorithms based on the well-known maximal weight scheduling (MWS) algorithm exist for cognitive radio networks, they require central processing of network-wide SU information. In this paper, a new distributed algorithm is introduced that asymptotically achieves the capacity region of the cognitive radio systems. Extensive simulation results are provided to illustrate the efficacy of the algorithm. Recently, it has been shown that carrier-sense multiple access (CSMA)-type random access algorithms can achieve the maximum possible throughput in ad hoc wireless networks. However, these algorithms assume an idealized continuous-time CSMA protocol where collisions can never occur. In addition, simulation results indicate that the delay performance of these algorithms can be quite bad. On the other hand, although some simple heuristics can yield much better delay performance for a large set of arrival rates, in general they may only achieve a fraction of the capacity region. In this paper, We have used Sensing and Sharing Algorithm to achieve the maximum throughput.