HackerRank Graph Quiz-2

Question 1

Time: 00:00:00
A[i][j]=1 in adjacency matrix depicts that 

there is an edge from vertex i to vertex j

there is an edge from vertex i to vertex j

there is an edge from vertex j to vertex i 

there is an edge from vertex j to vertex i 

this binary matrix contains all the cell values as one

this binary matrix contains all the cell values as one

this sparse matrix contains all the cell values as one

this sparse matrix contains all the cell values as one

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
An adjacency matrix can have 0 or 1 values and can be modified as weighted matrix:-

if all  the cell values store A[i][j]=0

if all  the cell values store A[i][j]=0

if all  the cell values store A[i][j]=1

if all  the cell values store A[i][j]=1

if all  the cell values store A[i][j]=weight of edge  

if all  the cell values store A[i][j]=weight of edge  

It cannot be modified as a weighted matrix

It cannot be modified as a weighted matrix

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Adjacency matrix provides -----------------------to determine if there is an edge between two nodes.

constant time access (O(n) )

constant time access (O(n) )

constant space access (O(n) )

constant space access (O(n) )

constant space access (O(1) )

constant space access (O(1) )

constant time access (O(1) )  

constant time access (O(1) )  

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Select the correct option

A sparse matrix - most of the elements are zero, whereas a dense matrix- most of the elements are non-zero.

A sparse matrix - most of the elements are zero, whereas a dense matrix- most of the elements are non-zero.

A sparse matrix - most of the elements are non-zero, whereas a dense matrix- most of the elements are zero.

A sparse matrix - most of the elements are non-zero, whereas a dense matrix- most of the elements are zero.

A sparse matrix - all of the elements are zero, whereas a dense matrix- most of the elements are one.

A sparse matrix - all of the elements are zero, whereas a dense matrix- most of the elements are one.

A sparse matrix - all of the elements are one, whereas a dense matrix- most of the elements are zero.

A sparse matrix - all of the elements are one, whereas a dense matrix- most of the elements are zero.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
What is the condition for an isolated node?

degree of edge=0

degree of edge=0

degree of edge=1

degree of edge=1

degree of node=1

degree of node=1

degree of node=0  

degree of node=0  

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
In which case adjacency list is better than adjacency matrix?

matrix is dense

matrix is dense

matrix is inclined

matrix is inclined

matrix is boolean

matrix is boolean

matrix is sparse

matrix is sparse

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
What does graph traversal depicts?

every vertex and edge are visited exactly once in a well-defined order.

every vertex and edge are visited exactly once in a well-defined order.

every vertex and edge are visited at most once in a well-defined order.

every vertex and edge are visited at most once in a well-defined order.

every vertex and edge are visited at least once in a well-defined order.

every vertex and edge are visited at least once in a well-defined order.

all

all

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Which algorithm works on the idea of backtracking?

DFS

DFS

BFS

BFS

Minimum Spanning Tree

Minimum Spanning Tree

Incidence Matrix

Incidence Matrix

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What among the following can be used to execute the recursive nature of DFS algorithm?

Queues

Queues

Linked List

Linked List

Stacks

Stacks

Arrays

Arrays

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
A digraph is a :-

directed graph 

directed graph 

each edge of the graph is associated with some direction

each edge of the graph is associated with some direction

traversing can be done only in the specified direction.

traversing can be done only in the specified direction.

all

all

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]