The cognitive infrastructureless network has received significant attention to reduce signaling load in next-generation networks, which are expected to be ultradense with very high peak rate but relatively lower expected traffic per user. Research in this area has evolved from the distributed algorithms requiring prior knowledge of the number of secondary users (SUs) $U$ to the existing algorithms, which can estimate $U$ independently by counting the number of collisions. The major drawback of these algorithms is the large number of collisions leading to wastage of power and bring down the effective life of battery operated SUs. In this paper, we develop algorithms that learn faster and incurs fewer collisions. We assume unknown $U$ with two types of networks: fixed $U$ (i.e., static networks) and time-varying $U$ (i.e., dynamic networks). Proposed algorithms are based on the multiplayer multi-armed bandit (MAB) approach. We show that the proposed algorithms offer constant regret (i.e., throughput loss) with high probability and sub-linear regret in static and dynamic networks, respectively. Theoretical analysis, simulation, and experimental results demonstrate the efficacy of the proposed algorithms in terms of vacant spectrum utilization, regret, and the number of collisions. Fewer collisions significantly increase the operational life of SUs.