Saturday, April 20, 2013

World finance leaders issue sober assessment

WASHINGTON (AP) ? World finance leaders issued a somber assessment on Saturday of the global economy, saying the recovery remains uneven with growth and jobs in short supply.

The steering committee for the 188-nation International Monetary Fund issued a final communique that called for decisive action to bolster growth. However, the major economies remained at odds over the best mix of policies to pursue.

"An uneven recovery is emerging but growth and job creation are still too weak. New risks are arising while several old risks remain," the IMF group said.

"The commodity that is in shorter supply now is confidence," Tharman Shanmugaratnam, the chairman of the IMF panel and Singapore's finance minister, told reporters. "We need to regenerate optimism and confidence."

The World Bank announced that its policy committee had approved a proposal to establish a goal of eliminating extreme poverty, defined as living on less than $1.25 per day, by 2030. It is estimated that there are still 1.2 billion people living in extreme poverty with sub-Saharan Africa accounting for more than one-third of the world's extreme poor.

World Bank President Jim Yong Kim called this goal "an historic moment" for the world. "We are no longer dreaming of a world without poverty. We have set an expiration date," Kim told reporters at a closing news conference.

Emma Seery, a spokesperson for Oxfam, the anti-poverty group, said while the World Bank's target was welcome "we are concerned that it will duck the tough choices needed to reach it."

The spring meetings of IMF and its sister lending agency, the World Bank, on Saturday followed two days of discussions among finance leaders of the Group of 20 nations, composed of traditional powers such as the United States, Japan and Germany and fast-growing developing nations such as China, Brazil and India.

The finance leaders sought to project an air of cooperation even though they were unable to resolve sharp differences that have risen to the surface following an initially botched bailout of Cyprus in March. The banking troubles in the small Mediterranean island country renewed fears that a prolonged European debt crisis still poses significant risks to the global economy.

The United States was represented at the finance meetings by Treasury Secretary Jacob Lew and Federal Reserve Chairman Ben Bernanke. The administration pushed for European nations to moderate their austerity programs of spending cuts and tax increases in favor of more stimulus to bolster growth and combat painfully high unemployment in countries such as Spain and Greece.

"'Strengthening global demand is imperative and must be at the top of our agenda," Lew said in his remarks to the IMF. "Stronger demand in Europe is critical to growth."

But this push was met with resistance from countries such as Germany and Britain, which believe that heavily indebted European nations must reduce their deficits to give markets confidence and keep government borrowing costs low.

In the end, the finance leaders sought to bridge the differences by issuing economic blueprints that left room for both the growth and austerity camps to claim victory.

Dutch Finance Minister Jeroen Dijsselbloem, the head of the Eurogroup, encompassing the 17 finance ministers whose countries use the euro currency, told reporters Saturday said that European nations needed to keep pushing to reduce huge budget deficits but "we can and will adjust" the speed that the deficit cuts are implemented to take into account economic conditions.

The G-20 nations did reject proposals to issue hard targets for reducing budget deficits, a victory for the United States and Japan, who had argued for more flexibility.

The G-20 joint statement singled out the recent aggressive credit-easing moves pushed by Japanese Prime Minister Shinzo Abe, saying they were intended to stop prolonged deflation and support domestic demand.

Those comments were viewed as giving a green light to Japan's program, which has driven the value of the yen down by more than 20 percent against the dollar since October. That sizable decline has raised concerns among U.S. manufacturing companies that Japan's real goal is not to boost growth through increasing domestic demand but to weaken the yen as a way to gain trade advantages.

To address those concerns, the G-20 did repeat language it used in February that all countries should not use their currency as a trade weapon and guard against policies that could trigger currency wars.

Japanese officials said they were pleased with the support they had received at the Washington meetings for their aggressive efforts to lift the world's third largest economy out of a two-decade slump. "There has been international understanding" of our efforts, Huruhiko Kuroda, head of the Bank of Japan, told reporters.

Lew said in his IMF remarks that the Obama administration would keep working to gain approval of budget legislation that has been stalled for nearly three years in Congress. The congressional approval is the last major roadblock to implementing an overhaul of the IMF's governing structure to give more power to developing nations. The change is expected to shift two seats on the IMF's 24-member executive board from Western Europe to developing countries.

Brazilian Finance Minister Guido Mantega blasted both the United States and Europe for the delay.

"America is unable and Europe is unwilling to follow through with agreed reforms," he said Saturday in his remarks to the IMF. "The institution's major shareholders are gambling ... with the IMF's legitimacy and credibility."

Source: http://news.yahoo.com/world-finance-leaders-issue-sober-assessment-195111134--finance.html

Missouri Election Results Amendment 64 marijuana Colorado Marijuana elizabeth warren puerto rico diane sawyer

Senate Budget Allows Democrats To Accuse House Republicans Of Hypocrisy

WASHINGTON -- Republicans spent four years berating the Democratic-led Senate for failing to pass a budget. Now that the Senate has approved a budget resolution, Democrats are accusing House Republican leaders of retreating from the legislative process they demanded.

"Republicans have repeatedly called for regular order ... they call for regular order all of the time," House Minority Leader Nancy Pelosi (D-Calif.) said at a press conference Wednesday, noting that House Democratic leaders sent a letter to House Speaker John Boehner (R-Ohio) urging him to appoint conferees "without delay." "They?ve repeatedly chastised the Senate for not passing a budget bill," Pelosi said.

"Regular order" refers to the legislative process under which bills go through a committee and then to the floor, allowing lawmakers to debate and make amendments. The alternative is often leaders putting forward bills, sometimes negotiated in backroom deals, and bringing them straight to the floor without much chance for amendments.

Democrats have spent the week escalating pressure on Republicans to convene a budget conference committee. That committee would sift through the vastly different Senate and House budgets, and identify areas of agreement. But House Budget Committee Chairman Paul Ryan (R-Wis.) said he wants a pre-conference framework first, even though until recently he, too, demanded regular order.

"In the past four years, the Senate hadn't done a budget. That means the process stopped," Ryan told CNN last month. "What we call regular order, where the House and the Senate pass a budget, then you try to reconcile the differences."

This week, Ryan told reporters on Capitol Hill the parties were so far apart that a conference wouldn't result in an agreement. Ryan added that he was working with Senate Budget Committee Chairwoman Patty Murray (D-Wash.) to iron out differences in their budget plans.

Rep. Chris Van Hollen (D-Md.), the ranking Democrat on the House Budget Committee, said Ryan was using "lousy" excuses.

Van Hollen sent Boehner his own letter, signed by all 17 Democrats on the House Budget Committee, calling for the speaker to convene a committee.

"The American public deserves this open debate. This is about our priorities and values of the country -- and how they're reflected in the budget," Van Hollen said in an interview with The Huffington Post. "It sounds like what Republicans are proposing is everybody go behind closed doors to figure this out, which directly contradicts everything they have told the American public about their approach."

Boehner defended the GOP's approach Thursday, arguing that the House majority was in fact following regular order.

"The chairmen of the two committees are talking, and as you all know, it?s customary that there?s no appointment of a formal conference until such time as there?s some basic framework worked out from which they can proceed," Boehner said at a press conference. He added that Democrats were seeking a conference committee because it would enable them to bring "politically motivated" motions to the floor.

"Under rules, if you appoint conferees and after 20 legislative days there?s no agreement, the minority has the right to offer motions to instruct, which become politically motivated bombs to throw up on the House floor," Boehner said. "So to be frank with all of you, we?re following what I would describe as regular order. These informal conversations are underway, and that?s the way it should be."

But Democrats said they had a clear sense of how a conference could work in their favor. Their goal, Van Hollen said, was for each party to litigate its vision for a fiscal pathway. He suggested Republicans were afraid to expose the "extremist, lop-sided nature" of Ryan's budget.

Democrats said they are confident there's widespread support for replacing the damaging cuts brought onto domestic spending by sequestration, rather than cutting further into non-defense programs as Ryan's budget does. Democrats have also signaled a willingness to cut entitlement spending if Republicans agree to new tax revenues. GOP leadership has emphatically stated that any new tax increases are off the table.

"I don't think that they're arguments will stand up in the light of day," Van Hollen said.

Also on HuffPost:

"; var coords = [-5, -72]; // display fb-bubble FloatingPrompt.embed(this, html, undefined, 'top', {fp_intersects:1, timeout_remove:2000,ignore_arrow: true, width:236, add_xy:coords, class_name: 'clear-overlay'}); });

Source: http://www.huffingtonpost.com/2013/04/18/senate-budget-democrats-hypocrisy_n_3113136.html

Andy Enfield La Salle University the voice Denny Hamlin My Chemical Romance Olympus Has Fallen Arnold Palmer Invitational 2013

CISPA, the Fourth Amendment, and you

Overshadowed by congressional action on guns and immigration is an Internet privacy bill that could affect most Americans, without them knowing it, on a daily basis.

Cyber Intelligence Sharing and Protection Act (or CISPA) is making its way through Congress, and it?s passed a House vote on Thursday.

The final vote in the House was 248-168, as 42 Democrats voted for the bill, while 28 Republicans voted against it.

And like gun control, it?s far from a done deal after the House passes CISPA. It would need Senate approval, and President Barack Obama has indicated he?ll possibly veto CISPA if it comes to his desk.

Both sides of Congress would need to muster a two-thirds majority vote to override the president?s veto, which would seem unlikely in the current political atmosphere of Washington.

At the heart of CISPA is a Fourth Amendment issue.

The amendment reads:

?The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.?

CISPA is designed to let the federal government work with private companies to fight hackers and cybercriminals in and outside of the United States. As part of the effort to detect cyber threats, private companies could voluntarily share with the government data about Internet users.

The sharing could be done in ?real time? as the cybercops try to defeat and track down the evildoers. Companies could also share data among themselves as part of the effort.

There are major drawbacks about the legislation, say CISPA?s critics. The privacy provisions for consumers, they claim, are vague or nonexistent. The government and companies can?t look at your personal data, such as medical records and tax returns, if they are part of the ?data dump? that is shared in real time. But the law doesn?t require that companies excise, or edit out, that information in the transfer process.

Another criticism is that a warrant isn?t needed for the government to obtain that information. And companies that share your information won?t be held legally liable for sharing that information, a practice that seemingly conflicts with privacy policies on existing websites.

CISPA?s biggest critic in Congress is a representative from Colorado, Jared Polis. The Democrat told the House on Wednesday, ?This is the biggest government takeover of personal information that I?ve seen during my time here in Congress.?

Mike Rogers, a Republican representative from Michigan and the House Intelligence Committee chairman, is leading the CISPA effort, along with Dutch Ruppersberger, a Democrat from Maryland.

Rogers believes the measure is long needed. ?People were stealing their identities, their accounts, their intellectual property, and subsequent to that, their jobs,? he recently said. ?[Web users] began to question the value of getting on Internet and using [it] for commercial purposes. Their trust in the free and open Internet ? was at risk.?

He has also stressed that participation in CISPA is voluntary for companies.

The Intelligence Committee also released a five-page document to counter what it calls ?myths? about CISPA, including how much personal data would be shared with the government?which it says would be a rare occurrence.

The American Civil Liberties Union, however, calls CISPA ?fatally flawed.?

?The core problem is that CISPA allows too much sensitive information to be shared with too many people in the first place, including the National Security Agency,? it says.

Unlike SOPA, the failed legislative attempt last year to halt online piracy, large tech companies are supporting the efforts to get CISPA passed.

At one time, Facebook and Microsoft had signed on to support CISPA, but now they are reportedly backing away. Google appears to be on the fence about the issue.

Major communications and utilities companies support CISPA, according to a list released by the House.

Last year, the House passed a similar CISPA bill, only to see it die in the Senate. Last August, a successful filibuster blocked CISPA from getting to the floor for a vote. Both libertarians and liberals had issues with the bill, and there were disagreements about which government agencies would be involved with CISPA.

The tea party-aligned group FreedomWorks is on record, again, as opposing CISPA on Fourth Amendment grounds.

?There are grave Fourth Amendment concerns with CISPA. The bill would override existing privacy laws to allow companies to share ?cyber threat information? with the federal government without making any reasonable effort to strip out any personal information from the file,? the group said in a statement.

The Electronic Frontier Foundation also has Fourth Amendment concerns.

?As it stands, CISPA is dangerously vague, and should not?allow for any expansion of?government powers through a series of poorly worded?definitions.??If the drafters intend to?give new powers to the government?s already extensive capacity to examine your?private?information, they should propose clear and specific language so we can?have a real debate,? the EFF said on its website.

Scott Bomboy is the editor-in-chief of the National Constitution Center.

Recent Constitution Daily Stories
Constitution Check: Is the hunger strike at Guantanamo Bay beyond court review?
Benjamin Franklin?s last days, funeral, and a U.S. Senate slight
Background checks defeated in key Senate vote

Also Read

Source: http://news.yahoo.com/cispa-fourth-amendment-143420272.html

norfolk island michael brockers lisa marie presley florida panthers tannehill joel ward mock draft

7 Tough Right-Angle Grinders, Tested

Ranking: ? ? ? ?
Price: $86
Amperage: 8.5
No-load speed: 10,000 rpm
Cord length: 79 inches
Weight: 5.8 pounds

Likes: We were pleasantly surprised by this inexpensive yet smooth-running grinder. It has more than enough power for homeowner needs and might serve for backup duty in a professional shop.

Dislikes: The tool is so basic, there's not a lot to complain about, save one gripe: The lock-on button is too small, inconveniently positioned, and balky.

Source: http://www.popularmechanics.com/home/reviews/power-tools/7-tough-right-angle-grinders-tested?src=rss

brave Stephanie Rice Meet the Pyro Karen Klein Colorado fires supreme court summer solstice

Do you know where your MagSafe converter is?

They don’t do it especially frequently, but Apple does sometimes change the power or sync connectors on their computers and mobile devices. ?You may find yourself the proud owner of a MagSafe to MagSafe 2 converter so that you can use your computer with some older Apple power adapters or the MagSafe power connector on [...]

Source: http://the-gadgeteer.com/2013/04/18/do-you-know-where-your-magsafe-converter-is/

Boston Marathon bombing irs new york times Friends Reunion Elena Delle Donne usa today yahoo news

Friday, April 19, 2013

Ants use 'math' to find fastest routes

Simon Tragust

Ants follow an indirect path across a surface of smooth felt (white) and rough felt (green), in order to reach their destination in the fastest time.

By Tanya Lewis
LiveScience

Just as light does, ants traveling through different materials follow the fastest path, not the shortest one.

A recent study found that when fire ants?(Wasmannia auropunctata) crossed different surfaces, the insects chose the route that would minimize their total walking time, rather than the distance traveled. The ants' behavior offers a window into how groups of social insects self-organize, the scientists say.

In optics, a ray of light traveling between two points takes the path that requires the least amount of time, even if it's not the shortest distance ? which is known as "Fermat's principle of least time." For example, imagine a lifeguard rushing to save someone in the ocean some distance down the beach. The quickest way for her to get to the victim would be to run along the beach first, in order to minimize the time she would have to spend swimming, which usually takes longer than running. [Album: The 11 Most Beautiful Math Equations]

In the study, researchers collected colonies of the little fire ant ? one of the world's 100 most invasive species ? at sites in Israel. Each colony contained a few thousand worker ants and several queens. The ants were placed in a corner of an enclosure, and cockroaches were provided as a food source in the opposite corner. To get to the cockroaches, the ants had to cross a foraging area covered with different materials: smooth felt, rough felt or a glassy surface. The scientists tested the ants on surfaces composed of pairs of these materials next to each other (glass and rough felt, glass and smooth felt, smooth felt and rough felt).

The ants traveled more quickly over the glassy material than they did over either type of felt, and they moved more rapidly over the smooth felt than over the rough felt.

En route to their roach banquet, the ants did not follow the most direct travel path, the study found. Rather, they followed an angled path, traveling over more of the smoother material in order to reach the food morsels in the shortest amount of time. The findings demonstrate that Fermat's principle of light travel also applies to living creatures, the researchers conclude.

The ants rely on trails of pheromones to find their way. The researchers suggest that the chemical trail might initially be random, but converges on the optimum route over time. This process illustrates self-organization and evolution, in which all possible routes are whittled down to the fastest one.

"We found that a general rule applies to a dynamic system that relies solely on communication (pheromones) and social cooperation," lead study author Jan Oettler of the University of Regensburg, Germany, told the news site Phys.org.?

However, the ants have their limits. Over shorter distances, the ants didn't perform as well in choosing the fastest path, possibly because there was more of the pheromone in each area.

Scientists have long known that ants choose the shortest of several paths to get to a food source, in order to minimize travel time or conserve energy. For example, harvester ants avoid paths with more vegetation, and wood ants prefer horizontal bridges to vertical ones.

The new findings were published March 20 in the journal PLOS ONE.

Follow Tanya Lewis on Twitter?and Google+.?Follow us @livescience, Facebook?and Google+. Original article on?LiveScience.com.

Copyright 2013 LiveScience, a TechMediaNetwork company. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Source: http://feeds.nbcnews.com/c/35002/f/653377/s/2ad7f818/l/0Lscience0Bnbcnews0N0C0Inews0C20A130C0A40C170C1779720A10Eants0Euse0Emath0Eto0Efind0Efastest0Eroutes0Dlite/story01.htm

marianas trench camille grammer camille grammer us supreme court breaking dawn part 2 trailer mississippi state chris carpenter

Wednesday, April 17, 2013

Count Frequency Of Strings In Java Binary Tree ... - Dream In Code


Example
#{example}
"); ipb.editor_values.get('templates')['togglesource'] = new Template("
??? Cancel Source Edit
"); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
  • Icon
  • "); ipb.editor_values.get('templates')['menu_item'] = new Template("
  • #{title}
  • "); ipb.editor_values.get('templates')['togglesource'] = new Template("
    ??? Cancel Source Edit
    "); ipb.editor_values.get('templates')['emoticons_showall'] = new Template(""); ipb.editor_values.get('templates')['emoticon_wrapper'] = new Template("

    Emoticons

    "); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html]\n \n[/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]\n \n Test\n \n[/xml]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"member":{"id":"31","title":"Member","desc":"Given a member name, a link is automatically generated to the member's profile","tag":"member","useoption":"1","example":"[member=skyhawk133] runs this site.","switch_option":"0","menu_option_text":"Input Username of Member","menu_content_text":"","single_tag":"1","optional_option":"0","image":"memberbbcode.png"},"extract":{"id":"33","title":"Extract Blog Entry","desc":"This will allow users to define an extract for an entry. Only this piece of the entry will be displayed on the main blog page and will show up in the RSS feed.","tag":"extract","useoption":"0","example":"[extract]This is an example![/extract]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"blog":{"id":"34","title":"Blog Link","desc":"This tag provides an easy way to link to a blog.","tag":"blog","useoption":"1","example":"[blog=100]Click me![/blog]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"entry":{"id":"35","title":"Blog Entry Link","desc":"This tag provides an easy way to link to a blog entry.","tag":"entry","useoption":"1","example":"[entry=100]Click me![/entry]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"twitter":{"id":"36","title":"Twitter","desc":"A tag to link to a user's twitter account","tag":"twitter","useoption":"0","example":"[twitter]userName[/twitter]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":"twitter.png"},"inline":{"id":"37","title":"Inline Code","desc":"Formats code inline instead of in a seperate code box. ","tag":"inline","useoption":"0","example":"[inline]style=\"font-size: 12px;\"[/inline]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"il":{"id":"38","title":"Abbreviated Inline (IL)","desc":"Abbreviated version of the [inline] tag. ","tag":"il","useoption":"0","example":"[il]Code Here[/il]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":"il2.png"},"code":{"id":"41","title":"Code","desc":"Allows you to enter general code","tag":"code","useoption":"1","example":"[code]$text = 'Some long code here';[/code]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"1","image":""}}) ); ipb.vars['emoticon_url'] = "http://cdn.dreamincode.net/forums/public/style_emoticons/default"; //Search Setup ipb.vars['search_type'] = 'forum'; ipb.vars['search_type_id'] = 32; ipb.vars['search_type_2'] = 'topic'; ipb.vars['search_type_id_2'] = 318700; //]]>

    3 Replies - 23 Views - Last Post: 18 minutes ago Rate Topic: -----

    #1 ccb77 ?Icon User is online

    Reputation: 0

    • Posts: 13
    • Joined: 24-March 13

    Posted Today, 12:14 PM

    How do I implement a frequency counter in a treenode that increases when the user enters an existing word?

    I have a program where the user is asked to choose: enter string, search for string

    My frequency counter is not working properly. How do I keep track of the frequencies for the left and right nodes? My frequency counter only gives for root:

    
 public void insert(String item){  		if(isEmpty()){		 			root = new TreeNode(item);                          System.out.println("inserted " + "'" + item + "'" + " into tree. Frequency: " + root.getFreq());                 }                // If string item already exists, do not insert another node, increase the frequency of the node containing the string                         else if(searchTree(root,item) == true){                             root.upFreq();                                                          System.out.println( "'" + item + "'" + " already exists! Frequency: " + root.getFreq());                  //if the string does not already exists, enters string item into new node                                } else{                                                root.add(item);                      System.out.println("inserted " + "'" + item + "'" + " into tree! Frequency: " + root.getFreq());                              }                            }   
    
  static boolean searchTree(TreeNode root, String item){             if(root == null){                 return false;             }             if(root.item.equals(item)){                 //root.upFreq();                                  return true;                         }             return searchTree(root.left, item) || searchTree(root.right, item);             } 


    Is This A Good Question/Topic? 0

    Replies To: count frequency of strings in java binary tree

    #2 baavgai ?Icon User is online

    Reputation: 4823

    • Posts: 11,185
    • Joined: 16-October 07

    Re: count frequency of strings in java binary tree

    Posted 47 minutes ago

    Dude! How in the hell can your searchTree be static?!? Tell me TreeNode isn't public...

    Your searchTree is, um, disturbing. You should be going left or right, not returning left || right. You call it and seem to expect that root has meaning. It doesn't.

    Implement a find item. Go from there:

    
 private TreeNode findNode(TreeNode parent, String item) { /* your code here */ }  private TreeNode insert(TreeNode parent, String item) { /* your code here */ }  private boolean searchTree(String item) { return findNode(this.root, item)!=null; }  public void insert(String item){ 	if(isEmpty()){ 		this.root = new TreeNode(item);  		System.out.println("inserted " + "'" + item + "'" + " into tree. Frequency: " + root.getFreq()); 	} else { 		TreeNode node = findNode(this.root, item); 		if(node!=null) { 			node.upFreq(); 			System.out.print( "'" + item + "'" + " already exists!"); 		} else { 			node = insert(this.root, item); 			System.out.print("inserted " + "'" + item + "'" + " into tree!"); 		}   		System.out.println(" Frequency: " + node.getFreq()); 	} } 

    Hope this helps.


    #3 ccb77 ?Icon User is online

    Reputation: 0

    • Posts: 13
    • Joined: 24-March 13

    Re: count frequency of strings in java binary tree

    Posted 29 minutes ago

    Thanks, no the treenode was not public, and the static was a typo.....


    #4 ccb77 ?Icon User is online

    Reputation: 0

    • Posts: 13
    • Joined: 24-March 13

    Re: count frequency of strings in java binary tree

    Posted 18 minutes ago


    Page 1 of 1


    Source: http://www.dreamincode.net/forums/topic/318700-count-frequency-of-strings-in-java-binary-tree/

    iOS 6.1 BlackBerry aapl Kwame Harris Vine dr oz sag awards