This solution uses forest
to create the tree. You enter the tree using standard bracket notation.
The following styles are created:
my node
which creates an elliptical node with various attributes - this is used for all main nodes of the tree;
my label
which takes 2 arguments: one specifies position etc. of the label and the other the content - this is used for the small labels on the branches between the main nodes of the tree;
my top
which takes 1 argument: this specifies the content of the rectangular node on top of a main node;
my label node
and my top node
specify the appearance etc. of the nodes created using my label={}{}
and my top={}
respectively.
The nice thing about this is that the tree itself can then be specified very simply and concisely:
[A\\10, my top=5
[B\\15, my top=5, my label={above left}{7}]
[C\\18, my top=5, my label={above}{8}]
[D\\20, my top=5, my label={below left}{6}]
]

\documentclass[tikz, border=5pt]{standalone}
\usepackage{forest}
\usetikzlibrary{shapes.geometric,backgrounds}
\begin{document}
\forestset{
my label/.style n args=2{
edge label={node [my label node, #1] {#2}},
},
my top/.style={
tikz={
\node [my top node] at (.north) {#1};
}
},
}
\tikzset{
my node/.style={shape=ellipse, draw, inner xsep=15pt, inner ysep=1.5pt, fill=white, thick},
my top node/.style={draw, anchor=south, on background layer, inner ysep=2pt, yshift=-.5pt, thick, fill=white},
my label node/.style={auto, midway, font=\sffamily\scriptsize, inner sep=1.5pt},
}
\begin{forest}
for tree={
grow'=0,
child anchor=west,
align=center,
s sep+=5pt,
l sep+=10pt,
font=\sffamily,
edge=thick,
thick,
my node,
}
[A\\10, my top=5
[B\\15, my top=5, my label={above left}{7}]
[C\\18, my top=5, my label={above}{8}]
[D\\20, my top=5, my label={below left}{6}]
]
\end{forest}
\end{document}