NBA

Knicks’ smallball lineup up to 4-0 after clobbering Cavs

Who knew Andrea Bargnani’s elbow injury would turn into the panacea the ailing Knicks needed.

In what is likely no coincidence, the Knicks steamrolled to their fourth straight rout without the big Italian, using a small-ball alignment that crushed the Cavaliers, 117-86, Thursday night at the Garden.

David Stern, a Knicks fan growing up, made his last appearance at the Garden, and the Knicks put on a show. J.R. Smith dazzled, Carmelo Anthony made more history and rookie Tim Hardaway Jr. created some personal history.

“This is the last game at the Garden where the balls are going to have my name on it,’’ Stern, the commissioner for the last 30 years, said on MSG Network during the conquest.

The Knicks did plenty right with the Stern-inscribed ball as the newly freewheeling, free-spirited club remained undefeated since Bargnani crashed to the court, injuring his left elbow.

The Heat come to town for Saturday’s Super Bowl Eve showdown and are getting a Knicks team that may be hitting its stride after a season of misery.

Smith had the two highlight plays of the night — driving down the baseline in the first quarter for a windmill dunk that had the Knicks bench in a tizzy. He created more buzz in the third quarter, hitting a stepback jumper off a crossover fake that proverbially broke the ankles of Cleveland’s Tristan Thompson, who fell on his back.

“We’re playing Knicks basketball,’’ Raymond Felton said. “Sharing the ball, everybody’s having fun. J.R.’s doing crazy dunks, making people fall. Timmy’s shooting all kinds of 3’s, Melo’s doing his thing. I’m throwing lobs to everybody. It’s fun basketball. I love it.’’

Anthony and Smith combined for 48 points, reminiscent of their 1-2 punch outings of last season. Anthony scored 18 of his 29 points in the first quarter, had one monster driving dunk himself and became the 50th player in NBA history to eclipse 19,000 points.

Hardaway Jr., fresh of being named to the Rookie-Sophomore Game on All-Star weekend, added a career-high 29 points, though 18 of the points came during fourth-quarter garbage time. He was 6 of 12 from 3-point land.

“He played beautifully,’’ coach Mike Woodson said.

Smith had a golden windmill dunk in the first quarter and wound up with 19, making a rare start as Iman Shumpert missed his season’s first game with a sprained right shoulder. Decimated by injuries, the Knicks, who dressed 10 players, were without Shumpert, Kenyon Martin, Amar’e Stoudemire, Beno Udrih and, of course, Bargnani, but it didn’t matter.

“It was fun to watch,’’ Anthony said. “Especially Tim getting in that groove. J.R. continuing to keep getting better. It’s something we’re going to need because of the run we’re trying to make.’’

The Knicks moved to 4-3 on a homestand that ends Saturday against the two-time defending champions.

When asked if this was a big litmus test considering the last four opponents had mediocre records, Tyson Chandler countered, “The competition was pretty good. These were the same teams that beat us earlier in the season.”

The Knicks took out Miami last month, but the Heat are coming off an embarrassing loss Wednesday to the Thunder and should be entering the big stage with a lot of to prove. The Knicks have won five of the last six meetings against Miami, dating to last season.

In the last four games, the Knicks have racked up 124, 110, 114 and 117 points. There is a different chemistry without Bargnani as Woodson has stuck with the small-ball alignment that features two point guards in Felton and Pablo Prigioni and Anthony at power forward.

Prigioni didn’t take a shot but played 22 minutes of tough defense on Cavs superstar point guard Kyrie Irving, who shot just 10 of 25 in scoring 24 points.

The rout was on early as the Knicks led 26-9 after six minutes.

“I just feel it’s working,’’ Felton said. “It worked for us last year. It’s working for us now. It’s been fun. I love to play with Pablo. It’s working so we’ll keep it going.’’