Is it better to apply to public schools or private schools if cost is a big consideration?

I am really struggling to make a decision on this financially - any personal insights?

When I was in high school, I read about the tuition in public colleges versus private colleges and I thought public colleges were much cheaper. It turns out however that many private schools do offer scholarships, and sometimes the college endowment is large enough to make a big difference. For example, I compared my cost of attending Stanford University vs. UC Berkeley, and it turned out I had a very generous offer from Stanford that made it cheaper to attend Stanford than Berkeley.