Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

# DSA - Graphs and Hashing -Q15

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Consider the following statements about computing out-degree of every vertex in a Graph G:

1. Given an adjacency-list representation of a directed graph G = (V, E), it takes $\dpi{100} \Theta(V + E)$ time to compute the out-degree of every vertex without any additional storage.

2. Given an adjacency-list representation of a directed graph G = (V , E), it takes $\dpi{100} \Theta(V )$ time to compute the out-degree of every vertex with $\dpi{100} \Theta(V )$ additional storage.

Which of the above is correct?

A. 1 Only

B. 2 Only

C. Both 1,2

D. None