Silent

 

DismissSoundCloud uses cookies. By browsing the site, you’re agreeing to our cookie policy.

 

BrendanSilent’s avatar

BrendanSilentPro Unlimited

Brendan Leipelt
Greenville, United States
FollowShare

 

The Sugar Mama of Anti-Muslim Hate

 

The Sugar Mama of Anti-Muslim Hate

Philanthropist Nina Rosenwald has used her millions to cement the alliance between the pro-Israel lobby and the Islamophobic fringe.

In late April, Geert Wilders arrived in New York City to tell his quixotic tale to a rapt American audience. The far-right Dutch Party of Freedom leader—perhaps the world’s most prominent anti-Muslim populist—was poised to release Marked for Death: Islam’s War Against the West and Me, a memoir just out from Regnery, the right-wing US publishing house, in which he recounts his courageous efforts to stop the “Islamicization” of Europe. On his US tour, Wilders proudly portrayed himself as a man on the run—a round-the-clock security detail guarding him against radical Muslims whose violent passions he had supposedly inflamed by his truth-telling—and as a man on the rise: the exodus of his party from the governing coalition had forced new elections in the Netherlands, throwing the country’s ossified establishment into chaos.

We Recommend

In the US today, the very ordinariness of Muslim-American life has become grounds for suspicion.

My dad, Dr. Sami Al-Arian, was arrested by the FBI on trumped up charges, sending a chill through the local Muslim community. Yet we found support from unlikely allies.

About the Author

Max Blumenthal
Max Blumenthal is an award-winning journalist whose work has appeared in the New York Times, the Los Angeles…

Also by the Author

A trip through the Negev Desert leads to the heart of Israel’s national nightmare.

For Syrian refugees in Jordan’s Zaatari camp, arguments about international law ring hollow.

Upon Wilders’s arrival in New York, a little-known think tank called the Gatestone Institute rolled out the red carpet for him. On April 30, before a select crowd that according to Gatestone’s website had paid $10,000 a head, he held forth on the persecution he had endured during his recent trial for incitement to hatred and discrimination. “This charade that happened in the Netherlands for the last few years could not have happened in your great country,” Wilders said in his speech. Then he cut to the heart of his appeal: “Islam is primarily a dangerous ideology rather than a religion. This is the truth. This violent ideology wants to impose Islamic Sharia law on the whole world, including us—the Kafirs, the non-Muslims…. Islam is the largest threat to freedom which the world is currently facing.”

Some Dutch liberals have branded him a demagogue who summons the ghosts of Europe’s dark past, but Wilders counters the accusation by assiduously cultivating Jewish support. He quotes Zionist forefather Theodor Herzl and boasts of his more than forty trips to Israel, where he once toiled on a rural kibbutz. Wilders, in fact, has made a special friend of right-wing Israeli Foreign Minister Avigdor Lieberman. In Wilders’s world, the Jewish state represents Fort Apache on the frontiers of the war against the barbarians threatening Western civilization. “Mothers in the West can sleep safely because Israeli mothers at night worry about their sons in the army,” he told the Gatestone Institute. “Their fight is our fight. We should support it.”

At the April event, Wilders’s seamless fusion of anti-Muslim bombast and pro-Israel cant was gratefully received by the Gatestone Institute’s founder and director, Nina Rosenwald, whom he acknowledged at the top of his jeremiad as another of his good friends. An heiress to the Sears Roebuck fortune, Rosenwald spreads her millions through the William Rosenwald Family Fund, a nonprofit foundation named for her father, a famed Jewish philanthropist who created the United Jewish Appeal in 1939. His daughter’s focus is more explicitly political. According to a report by the Center for American Progress titled “Fear Inc.,” Rosenwald and her sister Elizabeth Varet, who also directs the family foundation, have donated more than $2.8 million since 2000 to “organizations that fan the flames of Islamophobia.”

Besides funding a Who’s Who of anti-Muslim outfits, Rosenwald has served on the board of AIPAC, the central arm of America’s Israel lobby, and holds leadership roles in a host of mainstream pro-Israel organizations. As groups like AIPAC lead the charge for a US military strike on the Islamic Republic of Iran, threatening to turn apocalyptic visions of civilizational warfare into catastrophic reality, Rosenwald’s wealth has fueled a rapidly emerging alliance between the pro-Israel mainstream and the Islamophobic fringe. (In 2003 alone the Rosenwald Family Fund donated well over half of its $1.6 million in total contributions to pro-Israel and Islamophobic organizations.) This alliance serves to sanitize and legitimize professional anti-Muslim bigots like Wilders, allowing their ideas to mingle easily with those of neoconservative foreign policy heavyweights intent on promoting the appearance of a convergence between US and Israeli interests by invoking the specter of a common “Islamofascist” enemy. With Gatestone—which publicizes the writings of figures ranging from pro-Israel super-lawyer Alan Dershowitz to “counter-jihad” propagandist Robert Spencer, and boasts Harold Rhode, a neoconservative former Pentagon official credited, as a senior fellow, with helping to try to push the Bush administration to invade Iraq—Rosenwald has attempted to shift the alliance into overdrive.

Conspiracies, Witch Hunts and “Moderate Muslims”

Over the past decade, Rosenwald’s generosity has helped sustain the pet projects of “Islamofascism Awareness Week” organizer and Stalinist apostate David Horowitz. Her largesse has also supported former Lebanese Maronite TV anchor Brigitte Gabriel, who told an evangelical audience in 2006 that Muslims “have no souls—they are dead set on killing and destruction.” The Center for Security Policy (CSP), a Washington-based think tank directed by neoconservative former Pentagon official Frank Gaffney, has also thrived as a result of Rosenwald’s beneficence. The $437,000 in donations Gaffney reaped from the Rosenwald family enabled him to churn out conspiratorial pamphlets like his 2010 “Shariah: The Threat to America,” in which he warned that American Muslims were engaged in a “stealth jihad” to place the country under the control of Sharia, or Islamic law. At the Conservative Political Action Conference the following year, Gaffney sent his cadres to distribute fliers accusing top Republican anti-tax activists Grover Norquist and Suhail Khan of organizing a secret campaign dedicated to “the replacement of our constitutional republic…with a theocratic Islamic caliphate governing according to Shari’ah.” (David Steinmann, president of the Fund, sits on the board of Gaffney’s CSP.) Norquist is married to an Arab-American, and Khan, a former Republican Party official, is a fellow for Muslim-Christian Understanding at the Institute for Global Engagement. The American Conservative Union investigated Gaffney’s charges and declared them “reprehensible.”

Rosenwald has also used her money to support a seemingly sober set of self-proclaimed “dissident” Muslims who have seized the post-9/11 media spotlight to defend pro-Israel positions, Western military intervention in the Arab world and police spying on Muslim Americans. These beneficiaries include Irshad Manji, an openly gay Canadian TV personality and self-described “Muslim refusenik” who argued in her 2005 book, The Trouble With Islam Today, that “desert Arabs” and “Arab cultural imperialists” were imposing an anti-democratic, sexist and endemically anti-Semitic mindset on the rest of the world’s Muslims. In 2007 Rosenwald provided $10,000 in seed money for Manji’s new nonprofit, Project Ijtihad, which she founded to “help build the world’s most inclusive network of reform-minded Muslims and non-Muslim allies.”

Two years later Rosenwald pumped $10,000 into a similar but markedly more aggressive venture called the American Islamic Forum for Democracy. The group was founded by Zuhdi Jasser, an Arizona physician hailed by Glenn Beck as “the one Muslim we were all searching for after 9/11.” Despite his lack of academic or theological credentials, Jasser provided expert testimony last year before the Congressional hearing on Muslim American radicalization conducted by Representative Peter King of New York, widely criticized as a witch hunt. In early March, after the Associated Press exposed a secret NYPD unit monitoring Muslims throughout New York City and far beyond, Jasser issued a press release declaring, “We thank God every day for the NYPD.” That same day, he surfaced at a pro-NYPD rally in New York with King by his side. Then, only days later, over vehement objections from a coalition of Muslim groups, Senate Minority Leader Mitch McConnell installed Jasser as a member of the Commission on International Religious Freedom.

But no single anti-Muslim activist has benefited more from his relationship with Rosenwald than Middle East Forum founder Daniel Pipes, bankrolled to the tune of $2.3 million over the past ten years by the Rosenwald family’s philanthropies. Pipes thanked Rosenwald for “[taking] on a leadership role when the [Middle East] Forum was yet fledgling, helping us through some tough spots.” A former scholar at the Rosenwald-backed pro-Israel Washington Institute for Near East Policy (WINEP), Pipes has made a career of advocating aggressive US and Israeli military action in the Middle East, including the razing of entire Palestinian villages. Expressing his solidarity with Wilders, Pipes echoed the Dutch politician’s racial views on Muslim immigrants, describing them as “brown-skinned peoples cooking strange foods and not exactly maintaining Germanic standards of hygiene.”

Pipes occupies a central position at the nexus of the pro-Israel lobby and the Islamophophic fringe. In 2001 he neatly encapsulated the zero-sum mentality that defines his view of the alliance, declaring, “I worry very much, from the Jewish point of view, that the presence, and increased stature, and affluence, and enfranchisement of American Muslims, because they are so much led by an Islamist leadership, that this will present true dangers to American Jews.”

To his shame, Pipes earned eighteen citations in the manifesto of Norwegian terrorist Anders Behring Breivik, the self-proclaimed “counter-jihadist” standing trial for the murder of seventy-seven people, mostly teenagers. Drawing heavily on sources like Pipes to justify his actions, Breivik said he carried out the slaughter to punish Europe for succumbing to “Islamicization” and multiculturalism. Ranking just behind Pipes in Breivik’s thought was the Middle East Monitoring and Research Institute (MEMRI), with sixteen citations from the right-wing terrorist. Founded by a former Israeli intelligence officer to monitor and selectively disseminate Arabic-language media, MEMRI has become a key source for organizations in the Islamophobic network. MEMRI provided much of the translated material in the anti-Muslim Clarion Fund’s mass-distributed propaganda film Obsession: Radical Islam’s War Against the West. The Clarion Fund and MEMRI have received handsome donations from the Rosenwald family.

“We can give Nina Rosenwald the benefit of the doubt and say that in the past she didn’t know the poisonous ideological agenda of her beneficiaries,” Wajahat Ali, principal author of the “Fear Inc.” report, told me. “But at this point, she has no excuse for ignoring their extreme activities. So the question is why she continues to support them.”

Birth of a Benefactor

Who is this benefactor of Islamophobia? According to those familiar with Rosenwald, she is anything but a sophisticated Machiavellian operator—“a babe in the woods,” as one of her longtime acquaintances described her to me. (Rosenwald did not respond to interview requests sent to the Gatestone Institute and her personal e-mail.) According to another acquaintance, Rosenwald has a penchant for launching into anti-Arab anti-Palestinian tirades at public forums, leaping up like “a jack in the box” to denounce the evildoers. Despite her zealotry, Rosenwald maintains a reputation as a Manhattan socialite who travels in some of New York City’s most elite financial and political circles. Her wealthy friends gather for salons at upscale restaurants and in the living room of her Upper West Side apartment to meet major league political personalities, including former Secretary of State Henry Kissinger, neoconservative former UN Ambassador John Bolton (an associate of the Gatestone Institute) and the late right-wing media provocateur Andrew Breitbart.

Rosenwald counts among her closest friends Norman Podhoretz, the octogenarian neoconservative activist and former Commentary magazine editor who argues that Jewish Democrats are heretics betraying their religious duty to support the Jewish state. Rosenwald, according to one friend, is also close to Podhoretz’s daughter, Ruthie Blum, a right-wing columnist who lives in the illegal West Bank settlement of Har Adar and writes a column forIsrael Hayom, a newspaper published by far-right billionaire Sheldon Adelson, a chief financial supporter of Israeli Prime Minister Benajamin Netanyahu. Father and daughter echo the line of Likudnik Greater Israel ideology and anti-Muslim fanaticism, with Podhoretz urging the Western world to wage “World War IV” (the title of his post-9/11 polemic) against what he and Blum call “Islamofascism.” Blum has called for an Israeli war against Iran on the grounds that “Iran is soon to have atomic bombs with which it will attempt to impose Shariah law on the rest of the world—after wiping out the Jewish state.” Rosenwald has sustained Commentary (now edited by Podhoretz’s son John) with regular donations of up to $15,000—a modest but important sum for a right-wing Israel-centric magazine with an increasingly minuscule readership.

Through her affiliation with the Washington-based Hudson Institute, where Norman Podhoretz is an adjunct fellow, Rosenwald established a branch of the think tank in New York City. Operating under the Hudson banner, Rosenwald brought Wilders to town in 2008 to warn against the Muslim plot to “rule the world by the sword.” Wilders’s tirade during that visit against the prophet Muhammad, whom he described as “a warlord, a mass murderer, a pedophile,” was strident even by the standards of the hawkish Hudson Institute. By 2011, well before Wilders’s return visit this year, Rosenwald separated Hudson New York City from Hudson’s national branch, changing her organization’s name to the Gatestone Institute. Today, Rosenwald maintains a seat on Hudson’s board of directors.

Nina Rosenwald’s influence is based on the fortune her grandfather Julius earned at the turn of the century as co-owner of Sears, Roebuck & Company. Julius Rosenwald, renowned for his liberal philanthropy, used his fortune to nurture the careers of African-American leaders from Booker T. Washington to W.E.B. Du Bois and writers Langston Hughes and Claude McKay. Like many Reform Jews of his time, Rosenwald kept a cautious distance from Zionism, which organizations like the American Jewish Committee treated as a potential threat to Jewish assimilation in America.

Julius’s son, William, continued the philanthropic tradition his father inaugurated. With rabbis Abba Hillel Silver and Jonah Wise, two early leaders of the American Zionist movement, William Rosenwald helped form the United Jewish Appeal for Refugees and Overseas Needs to “fortify the Jews of all countries against anti-Semitic onslaughts.” Rosenwald’s efforts to resettle imperiled European Jews vaulted him into a lifetime of leadership of major Jewish organizations. In the aftermath of the 1967 war, when Israel began its illegal military occupation of the West Bank, Gaza Strip and Golan Heights, Rosenwald, like most Jewish institutional leaders, intensified his commitment to the cause of Zionism.

Following their father, Nina Rosenwald and her siblings became active in the pro-Israel community. While her sister Elizabeth has assumed a lower profile, there is hardly a single major pro-Israel organization that does not provide Rosenwald with a seat on its board of directors. Thanks to her financial generosity, Rosenwald sits on the board of influential neoconservative groups from WINEP and AIPAC as well as Hudson. She is the vice president of the Jewish Institute for National Security Affairs, which has provided training to thousands of American law enforcement and military officials from Israeli intelligence and police officers.

While entrenched in the pro-Israel establishment in the United States, Rosenwald has funneled hundreds of thousands of dollars into some of the Jewish state’s more unpleasant—and legally dubious—ventures. The Rosenwald Family Fund has provided at least $100,000, for example, to the Golan Fund, an initiative of the Israel Land Fund that aims to increase the “Jewish presence” in Israel’s Galilee region and the occupied Golan Heights by “obtain[ing] more of that [Arab] land for agricultural use,” according to its website. Extending its influence across the Green Line, the Rosenwald Family Fund has also provided financial support to the College of Judea (now Ariel University Center of Samaria) in the Israeli mega-settlement of Ariel; the Beit El yeshiva, a religious nationalist school situated in a West Bank settlement that instructs students to disobey government orders to abandon illegal settlement outposts; and to the Central Fund for Israel, a New York City–based nonprofit that serves as a major funding artery between American-based donors and the hardcore settlements of the West Bank.

According to Henry Siegman, a former executive director of the American Jewish Congress who serves as president of the US/Middle East Project, the Rosenwald family’s rightward trajectory reflects a generational shift within the Jewish American establishment. “The trend is not something that just emerged recently,” Siegman told me. “Over the last few decades, the Jewish Federations and AIPAC have played a significant role in shaping this reactionary move by advancing the notion that we should support any government in Israel and any policy that the government espouses. The Jewish organizations that opposed this line and took the opposite position were punished financially by the wealthy donors AIPAC was able to put together.”

As Islamophobia consumes broad sectors of America’s pro-Israel community, leading Israel advocacy groups are dispatching anti-Muslim speakers to college campuses across the country. Chief among them is StandWithUs, an organization that Danny Ayalon, Israel’s deputy foreign minister, says his government uses to “amplify our power.” In May StandWithUs sent Rosenwald beneficiary Jasser to appear beside a cast of neoconservative activists at a University of California, San Diego, event dedicated to condemning established human rights groups. Earlier in the year, StandWithUs dispatched Nonie Darwish, an ex-Muslim convert to evangelical Christianity who calls Islam “a poison to our society,” to speak at the University of New Mexico.

According to Siegman, the Jewish establishment’s loyalty to an Israeli government drifting irrevocably toward the far shores of the right has taken a terrible toll. “Islamophobia has gained many followers in the Jewish establishment and at this point has infected American Jewish life,” he commented. “The neocons are to a large extent responsible for that. And they did this at the price of alienating the younger generation, which is falling away.”

Editor’s Note: An earlier version of this article stated that Nina Rosenwald served as chair of the Middle East Media Research Institute’s board of directors. Rosenwald’s bio at the Hudson Institute lists several apparently false and out-of-date affiliations, among them a MEMRI chairmanship that never happened. We regret the error.

Also in This Forum

Moustafa Bayoumi, “Fear and Loathing of Islam
Jack Shaheen, “How the Media Created the Muslim Monster Myth
Petra Bartosiewicz, “Deploying Informants, the FBI Stings Muslims
Laila Lalami, “Islamophobia and Its Discontents
Abed Awad, “The True Story of Sharia in American Courts
Ramzi Kassem, “The Long Roots of the NYPD Spying Program
Laila Al-Arian, “When Your Father Is Accused of Terrorism

 

Add New Comment

Before commenting, please read our Community Guidelines.

  • Post as …
  • Image
                                        Sort by popular now                                                    Sort by best rating                                                    Sort by newest first                                                    Sort by oldest first                                

Showing 20 of 37 comments

  • michelle

    Muslim uses “Islamophobia” to intimidate us making weaker minds think that the scorn we have towards them is wrong that we have no right to oppose to there irrational tyrannical religion

  • michelle

    muslims now use “Islamophobia” to make weaker minds think that the feelings the scorn towards them is wrong when they clearly had shown the world how motherless dogs they really are and so people wont speak up and fight back to claim back there freedom from lazy, violent tryannical religion of there’s. but clearly is shown that muslims trying to reason with them is reasoning to a donkey

  • michelle

    how can anyone say muhammed had a positive impact on society when he was a pedophile who teaches violence and dont deny it muslims when clearly its quran states kill the infidels, when you all eager to go on this suppose holy war when your society only breed weak women and motherless dogs. when it Islamic anarchism leads its nations to chaos&violence! only pathetic nobodys want to waster their lives and time on empty promises. If western superpowers dont put a stop to this infestation, FREEDOM will be compromise they will go into our communities dress up as sheep when its Islamic anarchism gain majority and power leading our communities to tyranny, oppression, and forcing people to convert to a godless religion to only lead USA & western europe to anarchy just a choatic as muslim nations.
    IF THIS SUBTLE INVASION ISNT STOP NOW WHAT OUR FUTURE WILL HOLD AND OUR CHILDREN WHERE THEY WILL STAND ! OUR LIBERTY OUR NATURAL GOD GIVEN RIGHT WILL BE OBLIRATED FORCING PEOPLE TO CONVERT TO A TYRANNICAL RELIGION, LEADING OUR WESTERN NATIONS TO ANARCHY JUST AS ISLAMIC NATIONS HAVE FALLEN INTO CHAOS

  • amendment9

    The very use of the term “Islamophobia” as used here as a pejorative against anyone with eyes open in this world is exactly backwards and evidence that the author either possesses a willfully blind worldview or is completely intellectually dishonest. Realizing that a phobia is an irrational fear, one would have to be irrational NOT to fear those who kill in the name of Islam – even those whose killing is directed toward those not deemed sufficiently “Islamic” enough, as in Shia versus Sunni. As for the author’s characterization of Daniel Pipes, apparently he hasn’t even done the minimal amount of homework, for if he had he would understand that Mr. Pipe’s primary position is that moderate Islam is the answer. Constant use of labels such a “right-wing” is further evidence of intellectual laziness – why not synopsize the individual’s positions instead of throwing about labels, and let the reader draw one’s own conclusions. I am just as distressed when writers bandy about the term “liberal’ in a disdainful manner. All in all, the hyper-polemic style of the article is sadly typical of much political commentary these days, no matter from which side of the political spectrum it emanates.
    s

  • HerrinSchadenfreude

    “The very use of the term “Islamophobia” as used here as a pejorative
    against anyone with eyes open in this world is exactly backwards and
    evidence that the author either possesses a willfully blind worldview or
    is completely intellectually dishonest.”

    Funny. This sentence above loses almost nothing if I replace the term “Islamophobia” with “Antisemitism”.

    Oh no wait. I forgot. When you criticize the “wrong” group of unbalanced megalomaniacs who seem to think they’re “the only valid God’s” personal pooh-bahs, suddenly the words “hate” and “criticism” become synonyms in every dictionary on the face of the Earth. But only in America do people nod like bobble-heads and fist pump the idea of sending their own kids to kill or die 10K miles from home because of it.

    Does that not sound supportive enough? How about this : “EWE ESS AY! EWE ESS AY!!!

    Better?

    This woman is a blight. You prattle about balance yet if anybody. ANYBODY were to be outed doing what this woman is doing in an attempt to destroy Judaism, well, we know how you’d be talking then don’t we? Who you’d be comparing that person to? That happens if one doesn’t say the word Israel with the right twinkle in one’s eye.

  • Ideolect

    Having a fortune is a huge responsibility. Sadly the Rosenwalds are not morally competent, although Project Ijtihad may have some merit. Encouraging progressive Islam is worthwhile.

  • Mary Carroll

    How sad that the New York branch of the Rosenwald family has chosen such a narrow and hateful path!  There’s a branch of Julius Rosenwald’s family here in Chicago that has always been a committed pillar of the progressive community.

  • AKLady, Law

    Religion divides people. It is the scourge of humanity. It is no wonder communism attempted to outlaw religion. Christianity, in particular, teaches hate by its very belief system — accept JC or forever burn in hell.

  • ChicagoZionist

    What Mr Blumenthal means to say is that he disagrees violently with the worldview held by Nina Rosenwald and others that he assassinates in this offensive hatchet piece. There will always be Jew- and Israel-haters. Many of them will come from the Jewish community. And, shockingly, they will invoke age-old stereotypes (the wealthy, controlling Jew). Yet Blumenthal won’t use this type of language when describing those on the left that share his agenda. What else is new ? And by the way, ask the terrorized and dwindling Jewish communities of Europe (France, UK, Netherlands, etc.) how much they’re feeling the love from the Muslim community. Not so much.

    (Edited by author 1 year ago)

  • Slug Wannamaker

     The meme that anyone who criticizes Zionism is a “Jew- and Israel-hater” simply has no more credibility. And to say that any Jewish community in Europe is threatened by any Muslim community is sheer fear-mongering propaganda. What all of us do have to fear is extremism. And your comments are an example of it.

  • stannadel

     The meme has lost credibility–and that has given lots of cover to Antisemites who claim to just be anti-Zionist.  Not all anti-Zionists are Antisemites, but many are.

  • AKLady, Law

    All bigots are the same, regardless of national origin or religion:  they hate.

  • rushland

     So you want it to be a “Jew- and Israel-haters” :-)

    very telling of where one like you stand and of what Zionism calls for

    What differentiate you from a Muslim bigot and how come you pretend to
    be a modern day person when you see a religious state something “OK”?

     

  • aznative

    And you, sir, prove Mr Blumenthals point.

  • txposse

    This article is chocked full of good information.  Thank you.  I think if people live in peace with each other, one does not care what religion they follow.  So the real matter is non-violent religious expression, which should be encouraged and enforced.

  • zzz05

    On behalf of the majority of Jews who are not rightwing crazies (hey, we didn’t vote for war president Bush, you guys did; twice) I’d like to apologize for these guys, and point out that they are acting this way because they are rightwing crazies, not because they are Jewish. Because every other rightwing crazy, Jewish or otherwise, acts this way; and because the majority of Jews don’t.

    We’ve been watching the Middle East and Arabs and Islam  all our lives, and have had time to figure out who’s the good guys and who’s the bad guys. It’s the hillbillies who, before 9/11, thought the Middle East was next to the Midwest and still haven’t quite figured out Shiite vs Sunni and why Iranians aren’t Arabs  who are sporting the “kill em all and let God sort it out” bumper stickers they have left over from the 70s and driving around shooting everybody with a turban.

  • NJacana

     Hey y’all there!  Some hillbillies are fine folk who don’t give a hoot for all the arguing, and don’t believe in any god but banjo and fiddle–NOT guns and guts.  Peace out.

  • gkshenaut

    Why they are doing this is less important than why they are listened to and how they actually make things happen, which is because they are filthy rich. A rich person deserve exactly the same input into our political system as a poor person, yet, because of their money, the rich get a grossly disproportionate voice. Rich people can be just as wrong or even just as crazy as poor people. We keep forgetting this.

  • Slug Wannamaker

     One thing you’re forgetting is the greatly excessive influence the pro-Israel lobby has on US legislators – some, but not all of whom, are “hillbillies.”

  • AKLady, Law

    All zellots have things in common:  1) they are always right, and 2) their beliefs are the only valid opinions.  Does not matter what their skin color or religion is — they hate, they spew hate, they teach hate.

Trackback URL 

 

iSrael NeWz

Israel

Tsafrir Abayov/Associated Press

News about Israel, including commentary and archival articles published in The New York Times.

Israel Chronology

  1. OCT. 11, 2013

    Jewish settlers burn three Palestinian cars and scrawl graffiti on mosque in Israeli-occupied West Bank, latest in series of such attacks; settlers have attacked Palestinian communities 586 times in 2013, up from 370 in all of 2012MORE »

  2. OCT. 10, 2013

    Israeli soldier is lightly wounded by shrapnel when two mortar shells fired from Syria hit a military post in the Israeli-controlled Golan Heights.MORE »

  3. OCT. 10, 2013

    Jordan criticizes an Israeli plan to build a new international airport on the Red Sea, close to an existing one in Jordan.MORE »

  4. OCT. 10, 2013

    Op-Ed article by author Jeff Wheelwright argues that cleaning up the polluted Kidron River in the West Bank is a project that both Palestinians and Israelis should support because it offers a political opportunity for both sides; holds if the Palestinian Authority and Israeli government can work together on an uncontroversial civil project, they will start to develop a mutual trust.MORE »

  5. OCT. 8, 2013

    Palestinian Authority Pres Mahmoud Abbas expresses optimism that a peace agreement could be reached in the nine months allotted to the current round of negotiations in a rare meeting with Israeli politicians; Abbas alos pointedly avoids questions that proved provocative in the past.MORE »

Show More

Articles

Newest First | Oldest First

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next >>
Israel Warns Against Easing Sanctions on Iran
By ISABEL KERSHNER

The warning from Prime Minister Benjamin Netanyahu came as talks between Iran and the big powers over its nuclear program were about to resume.

October 15, 2013, Tuesday

Ten Jewish Men Detained at Temple Mount
By JODI RUDOREN

The men were detained but not arrested after singing and dancing at the site, the holiest in Judaism and third holiest in Islam.

October 15, 2013, Tuesday

When the Davis Cup Came in From the Cold
When the Davis Cup Came in From the Cold
By MATT RICHTEL

The Davis Cup in 1972 in Romania is considered one of the greatest Cup matches, but it was far more than just a tennis tournament.

October 14, 2013, Monday

Tunnel Found From Gaza Into Israel, Military Says
Tunnel Found From Gaza Into Israel, Military Says
By ISABEL KERSHNER

Responding to the discovery, the Israeli military said it had suspended the flow of building materials into Gaza because the tunnel could have been used for an attack against soldiers or civilians.

October 14, 2013, Monday

My Fake Levantine Romance
My Fake Levantine Romance
By CARA DORRIS

Our cultural differences blinded me to the obvious.

October 13, 2013, Sunday

Netanyahu Takes a Lonely Stance Denouncing Iran
Netanyahu Takes a Lonely Stance Denouncing Iran
By JODI RUDOREN

As Western powers prepare for talks on Iran’s nuclear program, an increasingly isolated Prime Minister Benjamin Netanyahu continues his push for stronger action.

October 12, 2013, Saturday

West Bank: Settlers Said to Deface a Mosque
By REUTERS

Jewish settlers burned three Palestinian cars and scrawled graffiti on a mosque in the Israeli-occupied West Bank on Thursday, village residents said.

October 11, 2013, Friday

Jordan: Criticism Over Israeli Plan for an Airport
By THE ASSOCIATED PRESS

Jordan criticized on Wednesday an Israeli plan to build a new international airport on the Red Sea, close to an existing one in Jordan.

October 10, 2013, Thursday

MORE ON ISRAEL AND: RED SEAISRAELJORDANAIRPORTS
Israel: Soldier Hurt by Mortar Shells From Syria
By ISABEL KERSHNER

An Israeli soldier was lightly wounded by shrapnel on Wednesday when two mortar shells fired from Syria hit a military post in the Israeli-controlled Golan Heights.

October 10, 2013, Thursday

MORE ON ISRAEL AND: SYRIAISRAELMIDDLE EAST
In a Polluted Stream, a Pathway to Peace
In a Polluted Stream, a Pathway to Peace
By JEFF WHEELWRIGHT

An issue that Palestinians and Israelis can work together on.

October 10, 2013, Thursday

Israel Expresses Dismay at Cutback of U.S. Aid to Egypt
By ISABEL KERSHNER

Officials view the aid as a vital element of Israel’s 1979 peace treaty with Egypt, and essential to stability in the region.

October 10, 2013, Thursday

Pictures of the Day: Pakistan and Elsewhere
By THE NEW YORK TIMES

Photos from Israel, Pakistan, South Korea and China.

October 08, 2013, Tuesday

MORE ON ISRAEL AND: CHINASOUTH KOREAPAKISTANISRAEL,PHOTOGRAPHY
Meeting With Israelis, Palestinian Leader Strikes a Conciliatory Tone on Peace Talks
By JODI RUDOREN

President Mahmoud Abbas of the Palestinian Authority expressed optimism that a peace agreement could be reached in the nine months allotted to the current round of talks.

October 8, 2013, Tuesday

The Anxiety of Exodus
The Anxiety of Exodus
By SHMUEL ROSNER

Israelis are fretting about emigration in spite of the facts.

October 07, 2013, Monday

Netanyahu Dressed Down After Appeal to Iranians
By THOMAS ERDBRINK

In response to remarks Prime Minister Benjamin Netanyahu of Israel made to BBC Persian, Iranians took to Twitter to inform him that they do, in fact, wear jeans and listen to Western music.

October 7, 2013, Monday

Gunfire Wounds Israeli Girl, 9, Playing in Yard in West Bank
By JODI RUDOREN

Israeli authorities said they suspected that the attack was carried out by a Palestinian who had broken into the settlement, Psagot, southeast of the Palestinian city of Ramallah.

October 6, 2013, Sunday

Netanyahu Plans to Meet With European Leaders on Iranian Nuclear Talks
Netanyahu Plans to Meet With European Leaders on Iranian Nuclear Talks
By JODI RUDOREN

Benjamin Netanyahu, the Israeli prime minister, hopes to influence coming negotiations over what he described as a “comprehensive international struggle.”

October 5, 2013, Saturday

MORE ON ISRAEL AND: NETANYAHU, BENJAMINISRAELIRANNUCLEAR WEAPONS
In a First, Saudis Cancel a Speech at the U.N.
By RICK GLADSTONE

Saudi Arabia, a strong ally of the United States, was said to be frustrated by policy setbacks over Syria, Iran and Palestinian statehood and did not submit a written statement in lieu of a speech.

October 4, 2013, Friday

U.S. and Israel Share a Goal in Iran Talks, but Not a Strategy
U.S. and Israel Share a Goal in Iran Talks, but Not a Strategy
By JODI RUDOREN and DAVID E. SANGER

The stated goal is to stop Iran from developing a nuclear weapon, but the mantra of the Israeli prime minister is “distrust, dismantle and verify,” while President Obama focuses on verifying the peaceful nature of the program.

October 4, 2013, Friday

When Israel Stepped Back From the Brink
By AVNER COHEN

Firsthand testimony challenges the popular but misguided narrative that Golda Meir’s government was on the verge of using nuclear weapons in 1973.

October 4, 2013, Friday

Bibi’s Tired Iranian Lines
Bibi’s Tired Iranian Lines
By ROGER COHEN

Netanyahu should retire the Third Reich analogies and focus on Israel-Palestine.

October 4, 2013, Friday

Kerry Says Talks With Iran Will Not Be Based on Trust
By JENNIFER STEINHAUER

In his first comments since Israel warned the United States about negotiating with Tehran, Secretary of State John Kerry expressed wariness over such talks.

October 4, 2013, Friday

Iran Frees Another Reformer, but Netanyahu Warns Iranians, in Persian, Not to Be ‘Dupes’
By ROBERT MACKEY

Iran released another political prisoner, and Israel’s prime minister slipped into Persian to suggest that only “sadeloh,” or “dupes,” would be fooled by the nation’s recent diplomatic overtures.

October 03, 2013, Thursday

Iran’s President Responds to Netanyahu
By RICK GLADSTONE

President Hassan Rouhani of Iran dismissed the verbal assault on his credibility by Prime Minister Benjamin Netanyahu of Israel the day before at the United Nations General Assembly.

October 3, 2013, Thursday

Israeli Leader Excoriates New President of Iran
Israeli Leader Excoriates New President of Iran
By SOMINI SENGUPTA and RICK GLADSTONE

Prime Minister Benjamin Netanyahu of Israel denounced the new president of Iran, Hassan Rouhani, saying Iran’s actions belied his soothing talk.

October 2, 2013, Wednesday

Video of Israel and Iran Sparring at U.N.
By ROBERT MACKEY

Following an address to the United Nations from Israel’s prime minister that was an extended attack on the credibility of Iran’s new president, an Iranian diplomat exercised his country’s right to reply.

October 01, 2013, Tuesday

Israel: Egyptian Rescuer Is Honored
By JODI RUDOREN

Mohamed Helmy, an Egyptian doctor who hid a Jewish woman in a cabin in Berlin during World War II, became the first Arab honored by Israel’s Holocaust memorial.

October 1, 2013, Tuesday

Discussing Iran, Obama and Netanyahu Display Unity
Discussing Iran, Obama and Netanyahu Display Unity
By MARK LANDLER

The Israeli prime minister said he was comforted to hear the president say that Iran’s “conciliatory words have to be matched by real actions.”

October 1, 2013, Tuesday

Amid Nuclear Issue, Israel Said to Arrest Iranian Spy
Amid Nuclear Issue, Israel Said to Arrest Iranian Spy
By ISABEL KERSHNER

The announcement came as Prime Minister Benjamin Netanyahu prepared to speak at the United Nations and warned against what he viewed as a deceptive charm offensive by President Hassan Rouhani of Iran.

September 30, 2013, Monday

Israel and Others in Mideast View Overtures of U.S. and Iran With Suspicion
Israel and Others in Mideast View Overtures of U.S. and Iran With Suspicion
By JODI RUDOREN

Iran’s rivals worry about its sincerity, and fear that President Obama’s desire for a diplomatic deal will only buy Iran time to continue its march toward building a nuclear weapon.

September 30, 2013, Monday

Israel and Others in Mideast View Overtures of U.S. and Iran With Suspicion
Israel and Others in Mideast View Overtures of U.S. and Iran With Suspicion
By JODI RUDOREN

Iran’s rivals worry about its sincerity, and fear that President Obama’s desire for a diplomatic deal will only buy Iran time to continue its march toward building a nuclear weapon.

September 29, 2013, Sunday

Israel: Violent Intifada Anniversary
By ISABEL KERSHNER

Hundreds of Palestinians clashed with Israeli security forces on Friday as Palestinians marked the 13th anniversary of the outbreak of the second intifada.

September 28, 2013, Saturday

Rouhani, Blunt and Charming, Pitches a Moderate Iran
Rouhani, Blunt and Charming, Pitches a Moderate Iran
By SOMINI SENGUPTA

Amid his fervent diplomatic theater this week, it was at times hard to tell whether Iran’s president, Hassan Rouhani, was a genuinely transformative leader.

September 27, 2013, Friday

Iran’s Leader, Denouncing Holocaust, Stirs Dispute
Iran’s Leader, Denouncing Holocaust, Stirs Dispute
By MARK LANDLER and THOMAS ERDBRINK

President Hassan Rouhani’s condemnation of the Holocaust has set off a political storm, landing him in precisely the kind of tangled dispute he had hoped to avoid.

September 26, 2013, Thursday

For Obama, an Evolving Doctrine on Foreign Policy
For Obama, an Evolving Doctrine on Foreign Policy
By DAVID E. SANGER

President Obama told world leaders on Tuesday that he was devoting the rest of his presidency to a negotiated end to the Iran confrontation, and creating a separate state for the Palestinians.

September 25, 2013, Wednesday

Hackers Crack into Red Hat

Hackers Crack into Red Hat

By John Fontana, NetworkWorld
  • Aug 23, 2008 5:35 AM
  • print
Red Hat confirmed Friday that hackers compromised infrastructure servers belonging to the company and the Fedora Project, including systems used to sign Fedora packages.

In the Fedora breach, company officials said they had “high confidence” the hackers did not get the “passphrase used to secure the Fedora package signing key.” Regardless, the company has converted to new Fedora signing keys.

Red Hat’s Fedora project leader Paul Frields made the announcement Friday on the fedora-announce-list with the subject line “Infrastructure Report.” When contacted, Red Hat officials pointed to Frields’ announcements as the company’s official statement.

In the Red Hat compromise, the intruder was able to sign a small number of OpenSSH packages relating to Red Hat Enterprise Linux 4 (i386 and x86_64 architectures only) and Red Hat Enterprise Linux 5 (x86_64 architecture only).

As a precaution, Red Hat released an updated version of those packages, a list of tampered packages and a script to check if any of the packages are installed on a user’s system.

“This is a significant issue and they have to work to address it,” says Jay Lyman, an open source analyst with The 451 Group. “These are some of the growing pains of a distribution becoming more complex. They are building more and more into their operating systems, and with that comes more complexity and more challenges. But what I think is most important here is the response.”

Red Hat first hinted at a problem on Aug. 14, when Frields wrote that the Fedora infrastructure team was investigating an issue that could result in some service outages. The message was followed up on Aug. 16 saying the team was “continuing to work on the problem.”

By that time, there were grumblings and rumors online and in discussion groups that internal systems may have been hacked, which indeed was the case, and was confirmed Friday by Red Hat.

In his announcement, Frields said changing the Fedora signing keys could require “affirmative steps” from every Fedora system owner or administrator, and said, if needed, those steps would be made public.

Frields also said that through checks of Fedora packages and source code that the company did not think packages had been compromised and said “at this time we are confident there is little risk to Fedora users who wish to install or upgrade signed Fedora packages.”

The Fedora Project released alpha code for Fedora 10, its next version, earlier this month.

On the Red Hat side, the company issued an OpenSSH update and guidance on how users can protect themselves.

The company said it was “highly confident” that the Red Hat Network, an internal system that makes updates and patches available to its customers, was not compromised by the hacker.

The company, however, said it was issuing its alert for those who “may obtain Red Hat binary packages via channels other than those of official Red Hat subscribers.”

Frields also made it clear that the affects of the intrusions on Fedora and Red Hat were not the same and that Fedora packages are signed with keys different from those used to sign Red Hat Enterprise Linux packages.

  • 0
    inShare
WE RECOMMEND

Netflix Drops HD DVD
Netflix Drops HD DVD
Review: The Asus ET2702 is a good all-in-one PC (if you can’t afford a Dell XPS 27 Touch)
Review: The Asus ET2702 is a good all-in-one PC (if you can’t afford a Dell XPS 27 Touch)
Acer S7-391 review: a serious edge for Windows 8
Acer S7-391 review: a serious edge for Windows 8
Google vs. Wikia Search
Google vs. Wikia Search
Who Ranked Highest in Private Cloud Storage Buyers Guide?
Sponsored
Who Ranked Highest in Private Cloud Storage Buyers Guide?
(The Register)
Netflix Drops HD DVD
Review: The Asus ET2702 is a good all-in-one PC (if you can’t afford a Dell XPS 27 Touch)
Acer S7-391 review: a serious edge for Windows 8
Google vs. Wikia Search
Who Ranked Highest in Private Cloud Storage Buyers Guide?

1comments

ADD YOURS

JimMcDash avatar

 

JimMcDash

 

08/25/2008 10:06 AM PDT

Boy those pesky hackers just dont know when to quit do they? LOL

RD

http://www.anotools.cq.bz

crack code interview

Thursday, 8 September 2011

Serialize and deserialize a binary tree

Writing the tree to a file is called ‘serialization’ and reading back from the file to reconstruct the exact same binary tree is ‘deserialization’.To serialize a binary tree  we need to store information  of inorder and one of preoder/postorder traversals in arrays and transfer the data . De-serialization can be done using inorder and preorder data. If the tree is a Binary Search Tree then we  need only  preorder /postorder.

Following is the code to create a binary tree from inorder and preorder traversals.I have not tested it, there may be typos.

struct TreeNode
{
struct TreeNode* left;
struct TreeNode* right;
int  elem;
};
TreeNode* BinaryTreeFromOrderings(int* inorder, int* preorder, int length)
{
if(length == 0)
{
return NULL;
}
//We have root then;
TreeNode* node = new TreeNode;
node->elem = *inorder;
int rootIndex = 0;
for(;rootIndex < length; rootIndex++)
{
if(inorder[rootIndex] == *inorder)
{
break;
}
}
//Left
node->left = BinaryTreeFromOrderings(inorder+1, preorder, rootIndex);
//Right
node->right = BinaryTreeFromOrderings(inorder + rootIndex + 1, preorder + rootIndex + 1, length – (rootIndex + 1));
return node;
}

Serialization/Deserialization of a Binary Tree

 

Serialization/Deserialization of a Binary Tree

September 29, 2010 in binary tree

Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called ‘serialization’ and reading back from the file to reconstruct the exact same binary tree is ‘deserialization’.

 

Being able to store a binary tree to a file presents lots of benefits. First, we are able to save the binary tree to a file and restore it at a later time. We are also able to transmit the binary tree representation via network and load it into another computer. Without doubt, serialization/deserialization of a binary tree is important and an algorithm to represent a binary tree in a compact way is very desirable.

 

Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be “resurrected” later in the same or another computer environment.

Hint:
If you have not read my previous article about Saving a Binary Search Tree to a File, you should read it now. Since we are dealing with a binary tree, not a binary search tree (BST), our previous method will not work. However, this will get you started.

Solution:
Our previous method will not work in the case of Binary Tree, because binary trees are not bound with the same rule as BST. In order for the nodes to be inserted at the correct place, we would need to output the NULL nodes using some kind of sentinel (Here, we use ‘#‘ as the sentinel) as we are doing pre-order traversal.

Assume we have a binary tree below:

    _30_ 
   /    \    
  10    20
 /     /  \ 
50    45  35

Using pre-order traversal, the algorithm should write the following to a file:

30 10 50 # # # 20 45 # # 35 # #

The pre-order traversal code below does all the job to serialize a binary tree, believe it or not!

1
2
3
4
5
6
7
8
9
void writeBinaryTree(BinaryTree *p, ostream &out) {
  if (!p) {
    out << “# “;
  } else {
    out << p->data << ” “;
    writeBinaryTree(p->left, out);
    writeBinaryTree(p->right, out);
  }
}

Deserializing a Binary Tree:

Reading the binary tree from the file is similar. We read tokens one at a time using pre-order traversal. If the token is a sentinel, we ignore it. If the token is a number, we insert it to the current node, and traverse to its left child, then its right child.

1
2
3
4
5
6
7
8
9
10
11
void readBinaryTree(BinaryTree *&p, ifstream &fin) {
  int token;
  bool isNumber;
  if (!readNextToken(token, fin, isNumber))
    return;
  if (isNumber) {
    p = new BinaryTree(token);
    readBinaryTree(p->left, fin);
    readBinaryTree(p->right, fin);
  }
}

Alternative Solution:
We may also use level-order traversal to write/read binary tree. Level-order traversal works because like pre-order traversal, we see the parent node before its child nodes. The implementation of it using level-order traversal is left as an exercise to the reader. Read my post: Printing a Binary Tree in Level Order on how to traverse a binary tree in level-order.

Further Thoughts:
There is an obvious shortcoming in this method, that is: a sentinel is required to represent empty nodes. What if we need to store strings that can contain any characters (including the sentinel) in the binary tree? Could you come up with a solution to overcome this shortcoming?

Please note that this is not the only way to serialize a binary tree, and also probably not the most compact way. But this is good enough for a standard interview question. If you would like to explore deeper, and even apply serialization/deserialization to general trees, you may read the Binary Tree article’s encoding section on Wikipedia.

Rating: 4.3/5 (11 votes cast)

Serialization/Deserialization of a Binary Tree, 4.3 out of 5 based on 11 ratings

 

21 responses to Serialization/Deserialization of a Binary Tree

  1. Your analysis of Binary Tree traversal is really good. I just saw a new one, maybe you can give me some thought. (Especially for the non-complete BST)

    Print all edge nodes of a complete binary tree anti-clockwise.
    That is all the left most nodes starting at root, then the leaves left to right and finally all the rightmost nodes.
    In other words, print the boundary of the tree.

    Variant: Print the same for a tree that is not complete.

    Thanks.

    +1
  2. Hint: Consider using depth-first traversal. You can detect if a node is a leaf node easily and print it out.

    For printing the left/right most nodes, you would need to pass some variables in to hold the state. Basically, if the current node is leftmost node, when you traverse its left child node, it is also a leftmost node.

    Note that the rightmost nodes are printed from bottom to top. You know how recursion works as a stack already if you had read some of my other posts. It’s a very handy trick to know.

    0
  3. did you miss the ‘!’? should it be:

    if (!p) {
    out << “# “;
    }

    0
  4. Thanks for catching that! My reader’s eyes are sharp :)

    Fixed.

    0
  5. Is the function “readNextToken” in STL? can’t find it…

    0
  6. johny said on May 12, 2011

    I have some question about the calling of “if (!readNextToken(token, fin, isNumber))” in your code.

    Since all function arguments are passed by value in C, shouldn’t it be written as “readNextToken(&token, fin, &isNumber)”?

    0
  7. johny said on May 12, 2011

    On second thought, if your prototype for readNextToken(token, fin, isNumber) is “bool readNextToken(int &token, ifstream &fin, bool &isNumber)” in line with C++ syntax (call by reference), then nothing is wrong in your calling.

    0
  8. How can the recursion of the function writeBinaryTree be stopped?

    0
  9. What is the time and space complexity guys?
    O(nlogn) – time
    O(height of the tree) – stack space.
    And extra space for sentinels?

    0
  10. RJ said on July 13, 2012

    I have a question – has anyone considered building a heap array out of a binary tree. For example, a node goes in position i, its left child goes in 2i+1 and right child goes in 2i+2. If either child does not exist then the place remains empty in the array. Some people have indicated that this is not the most efficient solution (once an interviewer). And, I am unable to understand why. May be I am missing something, can someone please explain? In my opinion, space wise, one node eats up 3 places in the array irrespective of the number of children – one for itself, one each for its left child and right child. But even in the pre-order traversal method, we save some sentinel for every null node, so we are allocating space for non-existent children even there. Time complexity wise, O(n) to serialize and O(nlogn) to build the tree back. So, what is inefficient about this method?

    0
    • If the tree is quite unbalanced, you will be wasting huge amount of space and time traversing these null nodes. Consider the extreme case of inorder insertion of an ordered array to a binary tree. On the other hand, sentinels terminates those null links at the very beginning.

      0
  11. Tom said on July 31, 2012

    Just understand refractions space and time

    0
  12. Tom said on July 31, 2012

    An angel of the arch.

    0
  13. Avatar Image

    1337c0d3r:
    if (isNumber) {
    p = new BinaryTree(token);
    readBinaryTree(p->left, fin);
    readBinaryTree(p->right, fin);
    }
    Shouldn’t you be setting p->left and p->right to null before making the call… Because say for example with the call on p->left , the character in the stream turns out to be “#”, then nothing is returned! shouldn’t we explicitly set it to null before the call is made.

    0
    • @Balaji: I think you can initialize p->left and p->right to null in BinaryTree’s constructor function. It is done when “new BinaryTree(token)”

      0
  14. http://www.cs.usfca.edu/~galles/cs245/lecture/lecture9.pdf
    Printing out nodes, in order that they would appear
    in a PREORDER traversal does not work, because
    we don’t know when we’ve hit a null pointer

    0
  15. sri said on March 13, 2013

    i think there are many possibilites of trees for a given preorder traversal

    0
  16. Avatar Image

    I am trying to write a java version:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    void readBinaryTreeHelper(TreeNode root, boolean left, Reader reader) {
      String token = reader.nextToken();
      if (token == ‘#’) {
        return;
      } else {
        TreeNode newNode = new TreeNode(Integer.parseInteger(token));
        if (left)
          root.left = newNode;
        else
          root.right = newNode;
        readBinaryTreeHelper(newNode, true, reader);
        readBinaryTreeHelper(newNode, false, reader);
      }
    TreeNode readBinaryTree(Reader reader) {
      String token = reader.nextToken();
      if (token == ‘#’) {
        return null;
      else {
        Node root = new TreeNode(Integer.parseInteger(token));
        readBinaryTreeHelper(root, true, reader);
        readBinaryTreeHelper(root, false, reader);
        return root;
      }
    }

     

    +5
  17. hey,
    I really like your posts. Thanks for all the great solutions and detailed explanation.
    I just have a question how to serialize/deserialize a generic tree (a.ka n-ary tree or k-ary tree). can you please provide a solution.

    Any help will be appreciated.

    0