Yosemite is an amazing National Park, one of the best that I have visited. Generally, you could stay there for weeks and don't get bored about the landscape. But from October it's pretty cold at night so I recommend to stay in a room (better than camping). For that reason, Mariposa is the best town to stay while you are visiting Yosemite (if you have a car): you are close to the park, you have nice places for eat (Happy Burger and Donut a go-go) and drink (some Far West bars), and the atmosphere of the town it's pretty interesting!