Skip to content

q11EvalBooleanBinaryTreeP

solutions.q11EvalBooleanBinaryTreeP

Question 11 [PY]

Evaluate a Boolean Binary Tree

Given a full binary tree \(B\) such that,

  • Leaf nodes bear binary truth values, i.e. True or False; and
  • Non leaf nodes bear values that represent logic gates, namely AND or OR.

WAP to evaluate the boolean binary tree \(B\) and return the result.

See also: Bbt

Functions:

Name Description
q11EvalBooleanBinaryTreeP

Args:

q11EvalBooleanBinaryTreeP(B)

Parameters:

Name Type Description Default
B Graph

Graph resolves into G.V and G.E. Guaranteed to be a binary tree containing Bbt values.

required