Air-filled tissues in various parts of the plant provide the buoyancy that allows them to float. In the Ludwigia helmithorrhiza as an example, parts of the root tissue are filled with air. You can see the thick, white roots, which look something like puffed rice.
I did not know that they float. I mean still I was assuming they are planted on reefs or sand.
Aquatic plants do float in the water as they possess special adaptations to remain on surface of water or underneath the waters. These plants possess a lot of spongy cells full of air which helps them float on surface of water.