The University of Virginia's top-ranked basketball team proved today it can come from behind against a good team without getting Ralph Sampson involved in the offense.

The only shot the Cavaliers' 7-foot-4 center took in the second half was a misdirected swat at a teammate's missed shot with about 12 minutes to play. Yet Virginia overcame a four-point deficit and beat North Carolina State, 45-40, with the help of four free throws in the final 24 seconds.

With 7-5 Chuck Nevitt leaning on him from behind and either 6-11 Thurl Bailey or muscular 6-7 Scott Parzych fronting him, Sampson was taken out of the offense, although he was outstanding defensively. He made only two of five shots--a jam off a loose ball and an eye-popping reverse scoop--but sank four of five pressure free throws to account for half of his team's last eight points.

Sampson scored fewer than 10 points for the fifth time in 25 games. "It doesn't bother me," he said. "I don't need the ball all the time."

While overcoming the Wolfpack's 30-26 lead in the last 15 minutes, the Cavaliers rarely got the ball inside, relying on the jump shooting of Othell Wilson and Craig Robinson to increase their record to 26-1 (11-1 in the Atlantic Coast Conference) with two games remaining.

"They've got a big team," Sampson said. "They have good height and good quickness. When a team puts two men on me, we have to go to other things."

Wolfpack Coach Jim Valvano's plan wasn't a novel one. It almost worked 10 days ago in Raleigh.

"It's hard for me to believe that we held Ralph without a shot in the second half twice and lost both times," Valvano said. "Our game plan, by and large, has been successful both times. We wanted to shut off Ralph and control the tempo and we did that."

In the previous game, Virginia survived a missed shot by Dereck Whittenburg in the closing seconds before Sampson's two free throws produced a 39-36 victory. Coach Terry Holland knew to expect the same defensive tactics today.

N.C. State (19-7, 6-6) was able to collapse on Sampson because guard Jeff Jones made only one of seven shots and forward Tim Mullen was scoreless. Aside from Jim Miller's four straight jump shots midway in the first half, the Cavaliers made 13 of 36 shots before intermission.

After the sixth tie (20-20), the visitors quieted the usual boisterous sellout crowd of 9,000 by scoring the next four points and taking a 24-20 lead at halftime.

Robinson's jumper in the lane and Wilson's follow of his own miss, pulled the Cavaliers even at 30, but N.C. State was back on top, 36-35, on Parzych's tap-in with 7:02 remaining. Wilson put Virginia in front for good with a base line jumper, but the game was far from over.

Virginia switched to a zone and after a Wolfpack miss, the Cavaliers were content to hold the ball for three minutes before Cozell McQueen fouled Sampson. The all-America center converted both attempts, giving his team a three-point lead.

Whittenburg, who with Sidney Lowe forms the Wolfpack's all-DeMatha High back court, quickly scored from 18 feet and, after Sampson missed the first shot of a one and one, N.C. State took possession with a chance to take the lead at 2:29.

The Cavaliers had fouls to give and Wilson, trying for steals, twice chopped Whittenburg. Then came a controversial call: Parzych was called for charging Miller 30 feet from the basket and Virginia regained possession with 1:20 remaining.

Robinson made two free throws 15 seconds later to make it 41-38, but again Whittenburg (eight points) scored from long range. With Virginia stalling, McQueen fouled Sampson away from the ball with 24 seconds left and Sampson made both shots. He then settled things by devouring Whittenburg's layup attempt.

"I'd like to play them again," said Valvano. "We've played the No. 1 team in the country twice within a basket and controlled the best player in the country."