WASHINGTON  Republican voters have sharply altered their views of the party’s presidential candidates following the early contests in Iowa and New Hampshire, with Senator John McCain, once widely written off, now viewed more favorably than any of his major competitors, according to the latest nationwide New York Times/CBS News Poll.

The findings underscored the extraordinary volatility in the Republican race and suggested that the party was continuing to search for a nominee whom it could rally around. Nearly three quarters of Republican primary voters said it was still too early for them to make up their minds “for sure,” meaning that they could shift their allegiances yet again if one or more of Mr. McCain’s rivals breaks through in the two Republican primaries this week, in Michigan and South Carolina.

On the Democratic side, Senator Barack Obama’s victory in Iowa has improved his standing within the party on a critical measure: his electability. The percentage of Democrats who say he would be the strongest candidate against the Republicans has more than doubled in a month, to 35 percent from 14 percent in December.

Senator Hillary Rodham Clinton, who won her party’s primary in New Hampshire, still has an edge on electability, a substantial advantage on experience  the central selling point of her campaign  and leads among Democrats nationally. But Mrs. Clinton and Mr. Obama are now viewed by Democrats as almost equally qualified on a variety of measures, including the ability to serve as commander in chief.