Small trees near ocean water?

There are only few trees that can survive in ocean or salty water. One of which is the mangroves that is commonly growing. They have already adapted the salinity of the waters.

I thought there are locusts that can survive?

Mangroves can really tolerate salt water. Locusts still need some soil and some trees still needs heavy sand for them to survive.