In this paper, we present a novel method for autonomous robotic exploration using a car-like robot. The proposed method uses the frontiers in the map to build a tree representing the structure of the environment to aid the goal-selection method. An augmentation of the method is also proposed which is able to manage the loops present in the environment. In this case, the environment is represented with a graph structure. A generalization of exploration methods is introduced to simplify the theoretical comparison between exploration methods. Two experiments are described. The first shows, that the success of the Sensor-Based Random Tree method is highly dependent on the dimensions of the environment. In the second experiment, a frontier-based exploration method used with greedy goal selection, the Sensor-Based Random Tree method, and the two proposed exploration methods are compared in three simulated environments. The experiments show, that the proposed methods outperform the existing methods both in the time taken until full exploration and the distance traveled during the exploration. The proposed exploration method was also tested using a real-life robot in an office scenario.