@Shaik Masthan sir, in this example https://gateoverflow.in/3548/gate2006-it-9 Arjun sir said "In tree degree is for outgoing edges only, and hence each degree corresponds to an edge" that means we have to count 0 for leaves
by this definition i am getting answer as 9 but answer given is 18.
is there any default case??
@Peeyush Pandey Same doubt here!
@Peeyush Pandey
@Manjeet Raj
@Sambhrant Maurya
@Tejasvi96
Here it's a tree NOT necessarily a directed binary tree which has a node having $0$, $1$ or $2$ degrees. So using Handshake Lemma for any general tree having $n$ nodes has the total degrees $$D=2|E|=2(n-1)=2*(10-1)=18$$
Outgoing edges of 2 are 3 (arrows in dotted lines)
Similarly, outgoing edges of 3 are 3
outgoing edges of 4,5,6,7 is 1
outgoing edges of 1 are 2.
Just see number of lines connected to particular node for outgoing edges.
Let d_{1}, d_{2, }...d_{n} be a degree sequence, then
$\sum_{k=1}^{n}$ d_{k} = 2*(n-1) , where n = number of vertices, IFF the given graph is a tree.
So, sum of degrees = 2*(10-1)
= 18