# Re: is this NP-Hard?

*From*: Talha Lateef <talhal82@xxxxxxxxx>*Date*: Mon, 3 May 2010 05:14:14 -0700 (PDT)

On May 3, 3:00 pm, Kai-Uwe Bux <jkherci...@xxxxxxx> wrote:

Talha Lateef wrote:

I am thinking of creating a tree with temp Result in each node, each

node has five childs {+,-,*,/,.}, if temp result of a node is greater

than my Result then i will stop calculating that branch.

But would that be justified? It appears that / or - can later decrease the

result. So, if you had

S = { 1, 2, 3, 4, 7 }

R = 2

(1+2+3) / (7-4) = 2

would do it, right? But in the evaluation, there are many subtrees that

evaluate to something bigger than 2.

Best

Kai-Uwe Bux

Excellent point Kai-Uwe i was just about to start coding data

structures, i was doing this because i would like to reduce work of

this brute-force approach, as you can see the nodes will increase 5

times in next level, i will rethink my strategy.

thanks

.

**References**:**Re: is this NP-Hard?***From:*Kai-Uwe Bux

**Re: is this NP-Hard?***From:*Talha Lateef

**Re: is this NP-Hard?***From:*Kai-Uwe Bux

- Prev by Date:
**Re: Finding the common elements in two strings .** - Next by Date:
**Re: Finding the common elements in two strings .** - Previous by thread:
**Re: is this NP-Hard?** - Next by thread:
**Overhead of Disk Read and write , Input/ output , etc** - Index(es):