[Tex/LaTex] Upside down tikz-qtree with concentrated edges

tikz-pgftikz-qtree

I would like to create an upside down tree with concentrate edges and labels inside the nodes as labels above them.

desired result

Right now I've come so far. But I still need the edges to concentrate/combine and put the labels + and * next to the overlapping bit. And I need to add the extra labels x, y, and z to the top nodes.

current situation

How do I get the tree from the first image? (The corners do not need to be rounded.) It is not absolutely necessary to use tikz-qtree.

\tikzstyle{var} = [draw,shape=rectangle,minimum size=2em,
                        inner sep=2pt,fill=white!20]
\tikzstyle{operator} = [draw=none,fill=none,minimum size=2em,
                        inner sep=2pt,fill=white!20]
\begin{tikzpicture}[grow'=up,level distance=1.25cm,sibling distance=1cm,]
  \tikzset{every node/.style={var}}
  \Tree [.7 \edge node[auto=right,style={operator}] {$+$};
            [.6 \edge node[auto=right,style={operator}] {$*$};
                [.2 ] [.3 ] ]
                      [.1 ] ]
\end{tikzpicture}

Best Answer

Here are both a version without and with tikz-qtree.

Code

\documentclass[tikz, border=2mm]{standalone}
\usepackage{tikz-qtree}
\usetikzlibrary{trees}

\begin{document}

\begin{tikzpicture}
[   numbers/.style={draw,rounded corners=1mm,minimum width=0.7cm,minimum height=0.7cm},
    operatorr/.style={draw=none,minimum width=0cm,minimum width=0cm,above=4mm},
    label/.style={above,font=\bf},
]
\node[numbers] (7) {7}
[   edge from parent fork up,
    grow=up,
    sibling distance=1.4cm,
    level distance=1.5cm,
]
    child {
        child {node[numbers] (1) {1}}
    }
    child[missing]{}
    child {node[numbers] (6) {6}
        child {node[numbers] (2) {2}}
        child {node[numbers] (3) {3}}
    };
\node[operatorr] at (7.90) {+};
\node[operatorr] at (6.90) {*};
\node[label] at (3.90) {x};
\node[label] at (2.90) {y};
\node[label] at (1.90) {z};

\end{tikzpicture}

\tikzstyle{var} = [draw,shape=rectangle,minimum size=2em,rounded corners=1mm]
\tikzstyle{operator} = [draw=none,fill=none,above,pos=0]

\begin{tikzpicture}
[   grow'=up,
    level distance=1.5cm,
    sibling distance=1cm,
    edge from parent fork up,
    edge from parent/.style={draw,rounded corners=1mm}
]
  \tikzset{every node/.style={var}}
  \Tree [.7 \edge node[operator] {$+$};
            [.6 \edge node[operator] {$*$};
            [.\node[label=90:\textbf{x}] {2}; ] [.\node[label=90:\textbf{y}] {3}; ]
          ]
          [ [.\node[label=90:\textbf{z}] {1};] 
          ]
        ]
\end{tikzpicture}

\end{document}

Output

enter image description here