| Snaprecruit.com

| Snaprecruit.com

Interview question based on skill :

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is ___________

Correct Answer is :

2. For some sparse graph an adjacency list is more space efficient against an adjacency matrix.

Correct Answer is : rr

3. Time complexity to find if there is an edge between 2 particular vertices is _________

Correct Answer is :

4. For the given conditions, which of the following is in the correct order of increasing space requirement? i) Undirected, no weight ii) Directed, no weight iii) Directed, weighted iv) Undirected, weighted

Correct Answer is : all of the mentioned

5. Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is __________

Correct Answer is :

6. Complete the given snippet of code for the adjacency list representation of a weighted directed graph. class neighbor { int vertex, weight; ____ next; }   class vertex { string name; _____ adjlist; }   vertex adjlists[101];

Correct Answer is : all of the mentioned

7. In which case adjacency list is preferred in front of an adjacency matrix?

Correct Answer is : DOMs

8. To create an adjacency list C++’s map container can be used.

Correct Answer is : DOMs

9. What would be the time complexity of the following function which adds an edge between two vertices i and j, with some weight ‘weigh’ to the graph having V vertices? vector adjacent[15] ; vector weight[15];   void addEdge(int i,int j,int weigh) { adjacent[a].push_back(i); adjacent[b].push_back(j); weight[a].push_back(weigh); weight[b].push_back(weigh); }

Correct Answer is : Animations

10. What would be the time complexity of the BFS traversal of a graph with n vertices and n1.25 edges?

Correct Answer is : Animations

11. The number of elements in the adjacency matrix of a graph having 7 vertices is __________

Correct Answer is : Generated Content for Paged Media

12. What would be the number of zeros in the adjacency matrix of the given graph?

Correct Answer is : Generated Content for Paged Media

13. Adjacency matrix of all graphs are symmetric.

Correct Answer is : Lists

14. The time complexity to calculate the number of edges in a graph whose information in stored in form of an adjacency matrix is ____________

Correct Answer is : Lists

15. For the adjacency matrix of a directed graph the row sum is the _________ degree and the column sum is the ________ degree.

Correct Answer is : Values and Units

16. What is the maximum number of possible non zero values in an adjacency matrix of a simple graph with n vertices?

Correct Answer is : Values and Units

17. On which of the following statements does the time complexity of checking if an edge exists between two particular vertices is not, depends?

Correct Answer is : E ~ F

18. In the given connected graph G, what is the value of rad(G) and diam(G)?

Correct Answer is : E ~ F

19. Which of these adjacency matrices represents a simple graph?

Correct Answer is : :default

20. Given an adjacency matrix A = [ [0, 1, 1], [1, 0, 1], [1, 1, 0] ], how many ways are there in which a vertex can walk to itself using 2 edges.

Correct Answer is : :default