Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,036 members, 7,818,060 topics. Date: Sunday, 05 May 2024 at 06:24 AM

Algorithms - How To Get Better At Solving Dynamic Programming Problems - Soltesh - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Algorithms - How To Get Better At Solving Dynamic Programming Problems - Soltesh (1030 Views)

Google Algorithms To Optimize SEO. / closed / Dynamic Web Design Tutorials Ft Javascript,Ajax,DOM,PHP,MySQL... (2) (3) (4)

(1) (Reply)

Algorithms - How To Get Better At Solving Dynamic Programming Problems - Soltesh by soltesh(m): 12:07pm On Jun 20, 2012
I recently came across this question: "You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, there are two ways to parenthesize 'true and false xor true' such that it evaluates to true."

I knew it is a dynamic programming problem so i tried to come up with a solution on my own which is as follows. Suppose we have a expression as A.B.C.....D where '.' represents any of the operations and, or, xor and the capital letters represent true or false. Lets say the number of ways for this expression of size K to produce a true is N. when a new boolean value E is added to this expression there are 2 ways to parenthesize this new expression 1. ((A.B.C.....D).E) ie. with all possible parenthesizations of A.B.C.....D we add E at the end. 2. (A.B.C.(D.E)) ie. evaluate D.E first and then find the number of ways this expression of size K can produce true.....................

share your own ideasrolleyes)::
http://www.excel-projects.com

(1) (Reply)

Top 5 Most Popular Sites In Nigeria (august) / Certifications At W3schools. / Good Tips To Help You Get Accepted To A CPA Network By Omoluwabi Oluwadahunsi

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.