Question 11
EasyWhat is the largest number of edges a simple undirected graph with n vertices can have?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
What is the largest number of edges a simple undirected graph with n vertices can have?
2ⁿ
n − 1
n²
n(n − 1)/2
Sign up free to see the answer and a step-by-step explanation.
In an undirected graph with E edges, what is the sum of all the vertex degrees?
E²
2E
E/2
E
Sign up free to see the answer and a step-by-step explanation.
What is a connected undirected graph?
One with no edges
One in which every vertex has degree 1
One that has a cycle
One in which there is a path between every pair of vertices
Sign up free to see the answer and a step-by-step explanation.
In graph terms, what is a tree?
A complete graph
Any graph with a root
A graph in which every vertex has two edges
A connected graph with no cycles
Sign up free to see the answer and a step-by-step explanation.
In a directed graph, what is the in-degree of a vertex?
The number of edges coming into it
The number of edges leaving it
The number of its neighbours' neighbours
Its distance from the start
Sign up free to see the answer and a step-by-step explanation.
An undirected graph has edges A–B, A–C, B–D and C–D, and neighbours are visited in alphabetical order. What is the BFS order starting from A?
A B D C
A D B C
A B C D
A C B D
Sign up free to see the answer and a step-by-step explanation.
An undirected graph has edges A–B, A–C, B–D and C–D, and neighbours are visited in alphabetical order. What is the DFS order starting from A?
A C D B
A B C D
A D C B
A B D C
Sign up free to see the answer and a step-by-step explanation.
In a graph, what is a path?
A vertex with no edges
A sequence of vertices in which each consecutive pair is joined by an edge
The list of all edges
Any set of vertices
Sign up free to see the answer and a step-by-step explanation.
What is a self-loop?
A vertex with no edges
An edge with weight 0
An edge from a vertex to itself
A cycle through every vertex
Sign up free to see the answer and a step-by-step explanation.
What is a complete graph?
A graph with all vertices coloured
A graph in which every pair of distinct vertices is joined by an edge
A graph with no cycles
A connected graph
Sign up free to see the answer and a step-by-step explanation.