cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Trees
Trees
Mar 12, 2013 at 6:29pm UTC
Script Coder
(1468)
Suppose you have a tree, with root node R and the you must paint every node in the tree red. You may only paint a node if you have painted its parent. How many ways are there of painting the tree.
Example, the tree:
4
\
2 3
\ /
1
Has got three ways of traversal:
1234
1243
1324
What is a general way to solve this problem?
Topic archived. No new replies allowed.