mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(curriculum): adding graphs and trees quiz questions (#62264)
Co-authored-by: Dario <105294544+Dario-DC@users.noreply.github.com>
This commit is contained in:
+100
-100
@@ -17,439 +17,439 @@ To pass the quiz, you must correctly answer at least 18 of the 20 questions belo
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is a graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A linear data structure that follows the Last-In, First-Out principle.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A data structure that stores multiple values of the same type that are contiguous in memory.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A linear data structure that follows the First-In, First-Out principle.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A data structure used to represent the connections or relationships between objects or entities.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following is NOT a typical scenario that can be represented using a graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
social networks
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
transportation networks
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
communications networks
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
virtual private networks
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following terms describes an object or entity that is part of the network depicted by a graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Cookie
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Endpoint
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
CPU
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Node
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following terms describes the connections between nodes in a graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Gates
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Connectors
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Vertices
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Edges
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is an undirected graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A graph where the nodes are undirected but the edges are directed.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A graph where the edges have a specific direction.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A graph where the nodes and edges connect at the midpoint.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A graph where the edges don't have a specific direction.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following refers to a graph in which each node is associated with a label or identifier in addition to its data?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Version labeled graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Virtual labeled graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Vertical labeled graph
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Vertex labeled graph
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following refers to a directed graph with at least one cycle?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Cycling graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Circulating graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Circular graph
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Cyclic graph
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is a weighted graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A specific type of edge labeled graph that shows only the direction of connections between nodes.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A specific type of edge labeled graph that assigns categories instead of numerical values to edges.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A specific type of edge labeled graph that treats all edge weights as equal regardless of label.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A specific type of edge labeled graph in which the labels on the edges represent values that can be compared and used to perform arithmetic operations.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is a directed acyclic graph?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A directed graph with one cycle.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A directed graph with three cycles.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A directed graph with two cycles.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A directed graph with no cycles.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following refers to a graph with two or more groups of nodes that are not connected by any edges?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Disconnect graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Disconnecting graph
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Disconnection graph
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Disconnected graph
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is the Breadth-first search algorithm?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
An algorithm that visits two nodes in one direction before moving another direction in the graph.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
An algorithm that visits all nodes in one direction before moving another direction in the graph.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
An algorithm that visits four nodes at a time before moving to the next level in the graph.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
An algorithm that visits all neighboring nodes before moving to the next level in the graph.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following algorithms will follow each branch as deep as possible before it backtracks?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Data-First Search
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Dock-First Search
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Daemon-First Search
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Depth-First Search
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following terms represents a two-dimensional list in which the rows and columns represent the graph's vertices?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Array matrix
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Depth matrix
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Vertex matrix
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Adjacency matrix
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following terms represents an array or dictionary that stores all the neighbors of each node?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Cyclic list
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Tuple list
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Breadth list
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Adjacency list
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What must be true for a graph to be classified as a tree?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
It must have at least one loop or cycle.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
It must have at least two loops or cycles.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
It must have three loops or cycles.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
It cannot have loops or cycles.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which of the following is a type of tree in which each node can have at most two child nodes?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Depth tree
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Spatial tree
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Linear tree
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Binary tree
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is a Trie?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A tree data structure used to store a set of numbers.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A tree data structure used to store a set of dictionaries.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A tree data structure used to store a set of lists.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A tree data structure used to store a set of strings.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
How does the priority queue data structure differ from a regular queue data structure?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A priority queue automatically removes duplicates before insertion.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A priority queue always processes elements in the order they were added.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A priority queue only stores elements of the same data type.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A priority queue processes elements based on their priority.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What are the two types of heaps?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Wide-heap and Tall-heap
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Horizontal-heap and Vertical-heap
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Breadth-heap and Depth-heap
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Max-heap and Min-heap
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What are the average and worst case time complexities for inserting and extracting the minimum or maximum value from a heap?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`O(n log n)`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`O(1)`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`O(n)`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`O(log n)`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user