If you're willing to camp and "rough it" slightly there may be lots of availability just outside the park if you can't get a campsite in it. Lots of the public lands (Forestry Service and Bureau of land management) have free camping all over the place, but usually don't have running water or toilets (but some do). I'm not entirely sure about how close they are around Yosemite as I haven't been there, but there seems be lots of free camping locations.
https://www.exploreserac.com/10-little-known-free-campsites-near-yosemite-national-park/
http://traveltips.usatoday.com/camping-near-yosemite-35497.html
It's the same near many national parks as we found out over the last couple of weeks in Utah. The most beautiful spots were in fact the free spots. Many will be down dirt roads however so if you're taking a Mustang or something then it may not be an option.
https://www.exploreserac.com/10-little-known-free-campsites-near-yosemite-national-park/
http://traveltips.usatoday.com/camping-near-yosemite-35497.html
It's the same near many national parks as we found out over the last couple of weeks in Utah. The most beautiful spots were in fact the free spots. Many will be down dirt roads however so if you're taking a Mustang or something then it may not be an option.