Former Knicks president Donnie Walsh, back at his old haunt, said yesterday he feels they have a legit shot to knock off the Heat and believes his 2011 trade for Carmelo Anthony has been justified.

“I think they’d give them a helluva series,’’ said Walsh, the Pacers’ president. “Miami and New York, I couldn’t pick it.’’

The Knicks locked up the second seed yesterday with a 90-80 Garden victory over Indiana. The No. 3 Pacers and Knicks are lined up to meet in the second round and, ironically, Anthony may come back to bite him.

Walsh was struck yesterday when he saw Anthony in person.

“His body is in super shape,’’ Walsh said. “That’s the only thing he had to improve. He could do everything else. You could see him on TV. But when you use him in person he’s slim. I haven’t seen him like that before. It’s showing.’’

Walsh was pilloried in some circles for giving up so many assets for Anthony in the February 2011 deal with Denver, including Danilo Gallinari, Raymond Felton, Wilson Chandler and Timofey Mozgov. It took a while for the Knicks to build back their depth after the deal.

“The blogs ripped it apart because we gave up a lot of players,’’ Walsh said. “I know I said to you guys, ‘I think this guy is so good you’re never going to get a chance to get a guy like this.’ As much as I didn’t want to give up the players we did, I thought we should do it.’’

The Anthony deal finally has paid off in his first full 82-game season as a Knick.

“He’s got better players around him now,’’ Walsh said. “He’s got a lot of veterans, real savvy guys. He has a lot of size. I love the way they’re playing. I love the way we’re playing. But I think they have a legitimate shot.

“He understands he’ll get double-teamed and the thing I always knew he could do — defend rebound, pass — he’s doing those things,’’ Walsh said.