In this paper, we introduce an efficient path planning algorithm designed for floor cleaning applications, utilizing the concept of Spanning Tree Coverage (STC). We operate under the assumption that the environment, i.e., the floor, is initially unknown to the robot, which also lacks knowledge regarding obstacle positions, except for the workspace boundaries. The robot executes alternating phases of exploration and coverage, leveraging the local map generated during exploration to construct a STC tree, which then guides the subsequent coverage (cleaning) phase. The extent of exploration is determined by the range of the robot's sensors. The path generation algorithms for cleaning fall within the broader category of coverage path planning (CPP) algorithms. A key advantage of this algorithm is that the robot returns to its initial position upon completing the operation, minimizing battery usage since sensors are only active during the exploration phase. We classify the proposed algorithm as an offline-online scheme. To validate the effectiveness and non-repetitive nature of the algorithm, we conducted simulations using VRep/MATLAB environments and implemented real-time experiments using Turtlebot in the ROS-Gazebo environment. The results substantiate the completeness of coverage and underscore the algorithm's significance in applications akin to floor cleaning.