toBe(5);
    sTree.insert(4);
    expect(sTree.root.left.data).toBe(4);
    sTree.insert(6);
    expect(sTree.root.right.data).toBe(6);
  });

  it('can find data for root and leafs', () => {
    let sTree = new TreeSearch();
    sTree.insert(5);
    sTree.insert(4);
    sTree.insert(6);
    sTree.insert(10);
    expect(sTree.root.data).not.toBe(null);
    expect(sTree.root.right.data).toBe(6);
    expect(sTree.root.left.data).toBe(4);
    expect(sTree.root.right.right.data).toBe(10);

  });
  it('can remove data for root and leafs', () => {
    let sTree = new TreeSearch();
    expect(sTree.root).toBe(null);
    sTree.insert(5);
    sTree.insert(4);
    sTree.insert(6);
    expect(sTree.root.left.data).toBe(4);
    expect(sTree.root.right.data).toBe(6);
    // sTree.insert(10);
    sTree.remove(4);
    expect(sTree.root.left).toBe(null);
    sTree.remove(6);
    expect(sTree.root.right).toBe(null);
  });

  it('can serialize data for root and leafs', () => {
    let sTree = new TreeSearch();
    expect(sTree.root).toBe(null);
   
    sTree.insert(5);
    sTree.insert(4);
    sTree.insert(6);
    sTree = sTree.serialize();
    expect(sTree[0]).toBe(5);
    expect(sTree[2,1,0]).toBe(5,4,6);
    expect(sTree[0,1,2]).toBe(6,4,5);
  });

  it('can deserialize data for root and leafs', () => {
    let sTree = new TreeSearch();    
    sTree.deserialize([3,4,2,7,8,1]);

    expect(sTree.root.data).toBe(3);
    expect(sTree.root.right.data).toBe(4);
    expect(sTree.root.left.data).toBe(2);
    expect(sTree.root.right.right.data).toBe(7);
    expect(sTree.root.right.right.right.data).toBe(8);
    expect(sTree.root.left.left.data).toBe(1);

  });

});Discussion in 'China' started by Daredevil, Oct 4, 2011.
The Doom and Gloom of China's Economy that is being increasingly predicted by Economists. Instead of scattered posting of news and discussion on this topic, this thread should be used for the purpose of proper discussion and context of this topic.
BEIJINGâ€”Troubles among small manufacturers in the bellwether Chinese city of Wenzhou are putting a cloud over a key part of China's economy, further shaking investor confidence and underscoring the stakes as Beijing tries to strike a balance between fostering growth and containing inflation.
More than two-dozen small, private businesses in the eastern city known for its entrepreneurial success have gone belly up in recent days because they couldn't repay maturing bank loans, according to state media reports. Wenzhou officials on Thursday urged banks to limit lending rates and make more funds available to small businesses amid worries about a credit crunch.
One of the businesses that closed this week was Zhejiang Xiang Yuan Steel Industry Co., state media said. A sales representative there who gave only his surname, Li, attributed the closure to pulled bank credit. He said the company had more than 100 employees, but he declined to comment further.
Others expressed worry over the business environment in Wenzhou. "The government has promised support for private businesses for years, and I've heard enough of it," said Qu Guoning, who runs one of the hundreds of small makers of electric wires and cables in the city and is fretting about how he will fund a planned business expansion.
The reports have added to downward pressure in China's stock and currency markets because Wenzhou was one of the first places to boom when China began to embrace private enterprise three decades ago and is considered the cradle of private-business ownership.
"Numerous reports of debt distress in Wenzhou have contributed to the latest iteration of China hard-landing anxiety," said Tim Condon, Singapore-based chief Asia economist with ING Groep NV. "The fear is that Wenzhou is the tip of an iceberg."
Further adding to worries over the small manufacturing sector, the HSBC China Manufacturing Purchasing Managers Index on Friday suggested manufacturing activity in September declined for the third straight time. The index is considered to be a gauge of the private sector's performance because it includes small companies. Analysts estimate the small- and medium-sized businesses in the private sector account for 80% of the country's jobs and more than half of economic output.
Damaged also by broader global market turmoil, China's benchmark Shanghai Composite Index fell 6.12 points, or 0.3%, to 2359.22 points Friday, its lowest close since April 2009. In currency markets, traders sent the yuan lower against the U.S. dollar even as China's central bank guided the currency higher. The move tested the trading limits Beijing uses to quell currency volatility for the third straight day.
China is constraining lending as part of its effort to tame inflation, which was spurred in part by its massive investment stimulus during the global financial crisis. But its clampdown on bank credit has put pressure on the private sector, leading to growing fears of a sharp slowdown of the economy that so far has served as a counterweight to weakened economies in the U.S. and Europe.
Wenzhou, a city of more than 1.9 million people, rose to prominence over the years for making cigarette lighters but is now known for its heavy concentrations of everything from sophisticated electronics manufacturing to property development. Its 360,000 small- and medium-sized enterprises account for more than 90% of the city's industrial output, which amounted to 271.5 billion yuan ($42.4 billion) in the first eight months of this year, according to government estimates.
But financial woes of its small manufacturers have intensified since last year, when China moved to rein in bank lending. Private companiesâ€”"which China's state banks have traditionally underserved in favor of lending to massive state-owned enterprisesâ€”have found financing increasingly hard to come by. In the first seven months of the year, Wenzhou enterprises posted a total of 640 million yuan (about $100 million) in losses, 220 million yuan more than a year earlier, according to local government data.
Zhou Dewen, head of the Wenzhou Small- and Medium-sized Enterprises Promotion Association, a trade group, said "banks are lending at usurious rates" in some cases. A number of the businesses that have closed their doors in recent weeks are members of his group, Mr. Zhou said, though he declined to elaborate.
Chinese officials have said repeatedly they don't anticipate a wave of small-company bankruptcies and have suggested ways to help the sector. In August, for instance, the National Development and the National Development and Reform Commission, China's top economic planning agency, unveiled new rules to encourage private companies to invest in what it calls "new strategic industries" including alternative energy, biotechnology and advanced equipment manufacturing, pledging that qualified private companies will be allowed to raise money by issuing bonds and stocks.
Mr. Qu, owner of the company that makes wires and cables, said he is planning to expand his business into making household appliances, a line of business that promises greater profitability, but which would need "tens of millions" of yuan in investment. Financing, he said, is difficult to get.
Mr. Qu said he is thinking about borrowing against the property he owns. "But the government's harsh crackdown on real estate has limited my ability to borrow using property as collateral," he said.
SPIEZ and maomao like this.
@CIr: While we appreciate Chinese progress, this is not the correct thread for it.
the gloom is bought by big companies bringing in big changes and improvement. the articles, if you had read highlighted about the apathy of small and medium size companies. what all you are showing or posting is only showing big company's big performance and achievement or in 1-2 cases the human development index activities.
this articles is written with SME in mind. not big companies like huawei or zte or geely or lenovo.
It seems the thread has riled up some Chinese members.
Anyways, the purpose of the thread is for the analysis of Chinese economy failures as reported in the news.
Cir, I have moved all your non-relevant posts to the China Economy Thread. So, please stay on topic. You can refute the points in the news but don't try to divert the topic with your overwhelming irrelevant posts.
Sept. 27 (Bloomberg) -- The cheapest Chinese