Deck 5: Methods

Full screen (f)
exit full mode
Question
To add a new node, you need to start a process by first placing it as _______ and move it up to maintain the heap property.

A) the last node in the heap
B) the new root
C) the right child of the root
D) the left child of the root
Use Space or
up arrow
down arrow
to flip the card.
Question
Show the inorder, preorder, and postorder of the following BST. Show the inorder, preorder, and postorder of the following BST.  <div style=padding-top: 35px>
Question
A _________ is the one in which every two pairs of vertices are connected.

A) complete graph
B) weighted graph
C) directed graph
Question
Show the BST after deleting 15 from the following BST.
Question
Find all shortest paths starting from vertex A in the following graph.
Question
Show the BST after inserting 45, 43, 100, 34, 23, and 3 into an empty BST.
Question
Show the BST after deleting 60 from the following BST.
Question
The time complexity of the DFS algorithm is <strong>The time complexity of the DFS algorithm is  </strong> A) true B) false <div style=padding-top: 35px>

A) true
B) false
Question
The ________ is to visit the left subtree of the current node first, then the current node itself, and finally the right subtree of the current node.

A) postorder traversal
B) preorder traversal
C) inorder traversal
D) breadth-first traversal
Question
A ___________ of a graph is a subgraph that is a tree and connects all vertices in the graph.

A) spanning tree
B) shorted path
Question
If two vertices are connected by two or more edges, these edges are called ______.

A) loop
B) parallel edge
C) weighted edge
D) directed edge
Question
A ____ is an edge that links a vertex to itself.

A) loop
B) parallel edge
C) weighted edge
D) directed edge
Question
Draw a DFS tree from the following graph starting from vertex E.
Question
The time complexity for finding an element in a binary search tree is _________.

A) O(logn)
B) O(nlogn)
C) O(n)
D) O(1)
Question
A graph may have several minimum spanning tree.

A) true
B) false
Question
Draw a BFS tree from the following graph starting from vertex E.
Question
Find a MST in the following graph.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/17
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 5: Methods
1
To add a new node, you need to start a process by first placing it as _______ and move it up to maintain the heap property.

A) the last node in the heap
B) the new root
C) the right child of the root
D) the left child of the root
A
2
Show the inorder, preorder, and postorder of the following BST. Show the inorder, preorder, and postorder of the following BST.
3
A _________ is the one in which every two pairs of vertices are connected.

A) complete graph
B) weighted graph
C) directed graph
A
4
Show the BST after deleting 15 from the following BST.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
5
Find all shortest paths starting from vertex A in the following graph.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
6
Show the BST after inserting 45, 43, 100, 34, 23, and 3 into an empty BST.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
7
Show the BST after deleting 60 from the following BST.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
8
The time complexity of the DFS algorithm is <strong>The time complexity of the DFS algorithm is  </strong> A) true B) false

A) true
B) false
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
9
The ________ is to visit the left subtree of the current node first, then the current node itself, and finally the right subtree of the current node.

A) postorder traversal
B) preorder traversal
C) inorder traversal
D) breadth-first traversal
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
10
A ___________ of a graph is a subgraph that is a tree and connects all vertices in the graph.

A) spanning tree
B) shorted path
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
11
If two vertices are connected by two or more edges, these edges are called ______.

A) loop
B) parallel edge
C) weighted edge
D) directed edge
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
12
A ____ is an edge that links a vertex to itself.

A) loop
B) parallel edge
C) weighted edge
D) directed edge
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
13
Draw a DFS tree from the following graph starting from vertex E.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
14
The time complexity for finding an element in a binary search tree is _________.

A) O(logn)
B) O(nlogn)
C) O(n)
D) O(1)
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
15
A graph may have several minimum spanning tree.

A) true
B) false
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
16
Draw a BFS tree from the following graph starting from vertex E.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
17
Find a MST in the following graph.
Unlock Deck
Unlock for access to all 17 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 17 flashcards in this deck.