I have the following images:

Binary Decision Diagram (BDD):



Binary Decision Tree (BDT):



and I would like to draw them in LaTeX with TikZ. 

Furthermore, I would like to make them "consistent" between each other (i.e., 0-edges becomes dashed arrows in both images, the two pictures must be in black and not in grayscale, no need for the labels on the arrows of the BDD).

How can this be done ?

So far I can only make the BDT with one style of arrow, and I have absolutely no idea how to make the BDD :|

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,arrows,positioning}
\begin{document}
\tikzset{
treenode/.style = {align=center},
c/.style = {treenode,circle,draw=black,minimum width=1.5em,minimum height=1.5em,text centered,font=\footnotesize},
r/.style = {treenode,rectangle,draw=black,minimum width=1.5em,minimum height=1.5em,text centered,font=\footnotesize},
level 1/.style={sibling distance=60mm},
level 2/.style={sibling distance=30mm},
level 3/.style={sibling distance=15mm},
level 4/.style={sibling distance=7mm}
}
\begin{tikzpicture}[-&gt;,&gt;=stealth',thick] 
\node[c] {a}
    child{ node[c] {b} 
            child{ node[c] {c}
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {0}}
                    }
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {1}}
                    }
            }
            child{ node [c] {c}
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {0}}
                    }
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {1}}
                    }
            }
    }
    child{ node[c] {b}
            child{ node [c] {c}
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {0}}
                    }
                    child{ node[c] {d}
                        child{ node[r] {0}}
                        child{ node[r] {1}}
                    }
            }
            child{ node [c] {c}
                    child{ node[c] {d}
                        child{ node[r] {1}}
                        child{ node[r] {1}}
                    }
                    child{ node[c] {d}
                        child{ node[r] {1}}
                        child{ node[r] {1}}
                    }
            }
    }
;
\end{tikzpicture}
\end{document}



Question: What does mathematics have to do with programming?
Answer: From a programmers perspective: Mathematics is a subset of programming.

Maths applied in programming:

When working with collections (arrays, lists, maps, etc) in programming, then you are dealing with real world implementations of mathematical abstractions.

Programming without maths:

If you do println("Hello World"), then the fact that some math is used to calculate the position on the screen, the length of the string, etc, is really mostly irrelevant.

Using programming for maths:

Implementing mathematics and physics in a programming language makes things like computer aided design possible.