360 views

1 Answer

0 votes
0 votes
To compute the out degree each vertex we would need $O(V+E)$.

To compute the in degree we have to scan through adjacency lists and count how many times each vertex has appeared. This is $O(V+E)$

Related questions

0 votes
0 votes
1 answer
2
akash.dinkar12 asked Apr 7, 2019
1,234 views
Give an adjacency-list representation for a complete binary tree on $7$ vertices. Give an equivalent adjacency-matrix representation. Assume that vertices are numbered fr...