SINGAPORE — One is a septuagenarian American president, the other a millennial North Korean dictator. But each has nuclear weapons and mixes taunts and tributes to keep the other off balance. Thin-skinned alphas, both men are wedded to a go-it-alone leadership style, have a penchant for bombast and are determined to project dominance when they finally meet.

As President Trump prepares for his summit here Tuesday with Kim Jong Un, he sees some of himself in the authoritarian North Korean: an un­or­tho­dox and sometimes feared figure who distrusts the established world order and has a thirst to make history.

Publicly, Trump has labeled Kim “Little Rocket Man” and in private with aides has called him “a crazy guy.” Kim, in turn, has called Trump a “mentally deranged U.S. dotard,” a word suggesting senility.

Yet advisers say Trump considers Kim a rational actor, and the president has flattered the North Korean leader recently with gratuitous praise. Trump is confident that he can negotiate the terms of a deal such that each man can walk away, despite his maximalist demands, with what he wants: for Trump, a promise of peace and denuclearization; for Kim, global legitimacy and prosperity.

“This is a leader who really is an unknown personality,” Trump said of Kim on Saturday, as he departed Canada en route to Singapore. “People don’t know much about him. I think that he’s going to surprise on the upside, very much on the upside. We’ll see.”

Trump acknowledges that achieving an accord could take multiple meetings, but people who have discussed the issue with him said he views negotiating with Kim as if it were another of his real estate deals in New York.

The U.S. president is banking on his forceful personality and what he sees as a singular ability to size up and manipulate competitors never mind the obvious differences between property development and nuclear arms. For him, the technical details of arms negotiations are trivial relative to the chemistry he could forge with his North Korean counterpart and the possibility of breaking down a thick geopolitical barrier.

“It’s about attitude,” Trump said Thursday. “It’s about willingness to get things done.”

In Trump’s mind, tone and posture are so important that he predicted he would be able to determine Kim’s level of seriousness about abandoning North Korea’s nuclear weapons “within the first minute” of their meeting.

“My touch, my feel — that’s what I do,” Trump said Saturday.

Victor D. Cha — a former George W. Bush administration official who negotiated with North Korea and who was dropped as a potential ambassador to South Korea by Trump — said the Singapore summit probably would shape domestic perceptions of both Trump and Kim.

Kim, he said, “constantly feels like he has to prove himself, and in that sense he’s going to do what no other North Korean leader has done, and that is command an audience with the president of the United States. And for Trump, this is the only diplomacy that he’s doing in the whole world right now. Everywhere else he’s either walking out of agreements or sanctioning countries. . . . This is Trump’s only chance to make a mark as a statesman.”

The nuclear talks with North Korea are the ultimate test of Trump’s vision of foreign policy, which is that he can accomplish things that no previous president could by virtue of his unique approach to personal diplomacy.

“In Donald J. Trump’s mind, he thinks that he has the ability to figure out a way to give [Kim] what he wants and to get what he wants. It’s just another deal to him,” said one longtime Trump adviser, who spoke on the condition of anonymity to offer a candid assessment. “. . . He thinks: Am I intellectually as smart as Jimmy Carter? No, but I don’t need to be. Do I have the vast reservoir of political cachet that the Bushes have? No, but I don’t need that. What do I have? I can go one-on-one playing tennis. I don’t need to play chess.”

A motivating force for Trump is former president Barack Obama, who told Trump before his inauguration that North Korea was the greatest geopolitical challenge he would face in office. Aides said the fact that Obama recognized the gravity of the threat and could not extinguish it only heightened Trump’s interest in finding a way to persuade Pyongyang to abandon its nuclear program.

“This is something that should have been solved by other presidents,” Trump said Thursday in the Rose Garden, appearing alongside Japanese Prime Minister Shinzo Abe. “I’m not just saying President Obama; I’m saying other presidents. A long time ago, this could have been solved in a lot easier manner and a lot less dangerous manner. But it wasn’t. So I’ll solve it, and we’ll get it done.”

For Kim — the inheritor of a communist dynasty that has been isolated from the world’s democracies for more than a ­half-century — protecting North Korea’s security is paramount, analysts say. And key to its security is the nuclear arsenal that Kim, his father and his grandfather developed. But Kim also is eager to bring his country the prestige and investment that would come with newfound cooperation with the United States.

To that end, Kim and his lieutenants have been studying Trump closely for many months in preparation for their meeting, according to U.S. analysts. Kim, 34, took office as supreme leader in 2011 and has had scant exposure to foreign dignitaries. He traveled twice in recent months to China to meet with President Xi Jinping — in part, analysts believe, to learn what he was in for with a direct encounter with Trump.

Daniel Russel, a former diplomat who negotiated with North Koreans in the Obama administration, said Kim’s top advisers are quite sophisticated in their knowledge of the United States.

“Yes, the North Korean team has pored over not only ‘The Art of the Deal,’ but also the publicly available record about Donald Trump, ranging from media coverage to ‘Fire and Fury,’ ” he said, referring, respectively, to Trump’s 1987 book and Michael Wolff’s account of the early months of the Trump White House.

Russel, a vice president at the Asia Society, added: “The Kim team is filled with veteran negotiators with abundant experience with the United States, and they are clearly doing their opposition research, whereas the Trump team is noticeably thin on regional expertise.”

A real danger for Trump is that he underestimates the North Korean delegation’s abilities to outsmart the Americans, analysts said.

“You go, these guys are just a bunch of poor people; we can handle this; just be nice to them,” Cha said. But, he added, the North Koreans “are going to look for that sweet spot in terms of putting things on the table that make Trump look good but don’t commit themselves to full denuclearization. If you’re not familiar with the history of the negotiations and all their tricks, you can walk right into this thing completely wide-eyed.”

Leading Trump’s preparations has been Secretary of State Mike Pompeo, who had limited experience in Asia policy before joining the Trump administration.

As the nation’s top diplomat — and as the CIA director before that — Pompeo has been dealing directly with Kim and his government to lay the groundwork for the Singapore summit. And in recent months he has been briefing Trump on the history of U.S.-North Korea relations, including military, commercial and economic aspects.

“There have been near-daily briefings, including today, where we have been providing the president all the information that he needs,” Pompeo told reporters Thursday. “And I am very confident that the president will be fully prepared when he meets with his North Korean counterpart.”

Trump’s advisers say the president believes his personal relationship with another world leader is the most important factor in relations between those two countries and can overwhelm other issues to extract a concession or reach an agreement.

Consider his approach to China, a rising geopolitical threat to the United States and one that, like North Korea, is an authoritarian state. Last year, Trump invited Xi to Mar-a-Lago, his private seaside club in Florida, in hopes that they could build a personal bond. Trump did not engage heavily in substance with Xi, such as on trade and other areas where they have disagreements. A few months later, Trump visited Xi in Beijing, where the Chinese president feted the visiting American in the Forbidden City.

“When you look at how President Trump has engaged potential adversaries in the past, there’s a clear pattern,” Russel said. “Neither one of those summits produced solutions to problems or concrete outcomes. President Trump left it to his subordinates, particularly on the trade side, to do the heavy lifting.”

Of all the foreign leaders Trump has encountered in his year and a half in office, Kim has been the most difficult for him to read, according to the president’s advisers.

“He’s unpredictable in ways I think President Trump prides himself on being,” said a former senior administration official, who spoke on the condition of anonymity to candidly discuss Trump’s approach to North Korea. “He’s unorthodox. In Kim, even Trump realizes he may have met his match.”