Unmanned aerial vehicles (UAVs) have opened up numerous opportunities in terms of connectivity, especially in the context of realizing the vision of ubiquitous connectivity for 5G and beyond (B5G). The ease of mobility makes the UAV base stations (UAV-BSs) a viable candidate for providing 'on demand' services to the users. Moreover, viewing the spectrum crunch experienced by traditional cellular networks, the UAV-BSs can share the burden of providing connectivity. UAV-BSs can open up several business opportunities for mobile network operators (MNOs). In this paper, we propose an open market model, where a UAV-BS has the opportunity to establish a link with a terrestrial BS (TBS) of an MNO that provides the best connectivity and offers a lower price. A distributed model is considered where the decision making power lies with the UAV-BS. The TBS-selection problem is modeled as an integer linear programming problem, where we compare the performance of the Greedy heuristic algorithm (GHA) and the backtracking algorithm (BA) to solve our selection problem. We also incorporate an energy prediction model which impacts the selection criteria. We analyze the performance GHA and BA algorithm by presenting a tradeoff between the two algorithms in terms of accuracy of TBS selection and convergence time.