The major difference between the two parks that will affect your decision based on what you are asking is that Yosemite is a large park with most of its visitor attraction areas concentrated into one small percentage of the park (the valley) and Yellowstone is a large park with its visitor attraction areas scattered over a vast area.
The high elevation areas of Yosemite are certainly scenic, but if snow occurs, it will not likely prevent you from moving about and seeing the things you want to see. The areas in higher altitude include the Tioga Pass area (not sure when that officially opens for the season- so you'll want to check on that if it was a part of your plan to drive toward or from Yellowstone), Glacier Point Road (with an amazing overlook of the entire valley) and the Mariposa Grove of giant sequoias, as well as the Hetch Hetchy area which the majority of people never visit. You could easily spend multiple days in the valley and be plenty busy and well-fed without realizing what you're missing outside of it. Probably at least 90% of the visitors to the park spend all of their time in the valley, and, as its title implies, it is at the lower elevation in the park. I believe the valley portion of the park stays open year-round.
In Yellowstone, with everything being so spread out, snow could really affect your plans for moving from one area to another. Although at that point, what snow does come down will probably be handled fairly quickly, it could put a dent in your plans for any given day. There is no guarantee that if you visit Yosemite first and then Yellowstone, you'll be safe from the possibility of snow, but doing so increases the likelihood you'll get more out of your trip.
Spend some time looking at maps of both parks to get a better idea of the arrangements:
Yosemite: www.nps.gov/yose/planyourvisit/maps.htm and Yellowstone: http://hfc.nps.gov/carto/PDF/YELLmap1.pdf
Another factor will be securing reservations for your accommodations in/near both of these parks. In-park accommodations for both parks sell out nearly a year in advance, so you will be reliant on cancellations or staying in gateway communities and this may affect the order in which you visit.