CSE 3500 mod 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Consider the greedy algorithm that solves the minimize lateness problem. In which order are the requests selected?

By increasing deadline

Which of the following best describes the cycle property?

Consider a cycle in the graph. The most expensive edge in the cycle cannot be in any minimum spanning tree.

Describe the cut property

Consider a partition of the nodes in a graph into two sets. The cheapest edge joining the sets must be in any MST.

In Dijkstra's algorithm, nodes will be added iteratively to a tree of shortest paths. Which one of the following selection strategies best describes Dijkstra's algorithm?

Consider all nodes reachable from the tree that are not already in the tree. Choose the one that has the shortest distance from the start node

Which proof technique is commonly used to show that a greedy algorithm is not optimal?

Counterexample

Consider the problem of finding a minimum spanning tree of a weighted graph. Which one of the following algorithms does not find an optimal solution to the problem?

Dijkstra's algorithm

Consider an undirected graph G and a start node s. Which one of the following statements is not true regarding a BFS in the graph G from s?

Edges that are in G but not in the BFS tree connect nodes in the same layer

Which one of the following statements regarding bipartite graphs is not true?

Every bipartite graph is a tree

Consider the proof of correctness of Dijkstra's algorithm. We call the graph G, the start node s, the set of explored nodes S and the set of active nodes A. What is the claim that we prove to be true in each step of the algorithm?

For any node v in S, the path from s to v given by the algorithm is the shortest s-v-path in G. No shorter path can be found outside of S.

Consider an undirected graph G with n nodes. Which one of the following four statements implies the other three?

G is a tree

What strategy is used to determine connectivity in a graph?

Graph search

Proof Technique for interval scheduling?

Greedy Stays Ahead

Which proof technique is used to show that the greedy algorithm that solves the interval scheduling problem is optimal?

Greedy Stays Ahead

Which strategy is used to prove the correctness of Dijkstra's algorithm?

Greedy Stays Ahead

Which one of the following statements regarding a DAG is not true?

If a directed graph has at least one node with no incoming edges, the graph is a DAG.

Which one of the following statements regarding topological orderings is not true?

If a topological ordering exists, it is unique.

Which statement regarding strongly connected components in a digraph is not true?

If two nodes u and v belong to different strongly connected components, there can be no path from u to v.

In the proof of correctness of Dijkstra's algorithm, we use induction on k. What does k represent?

The number of explored nodes

Consider a graph G with n nodes and m edges. What is the sum of the degrees of all the nodes in the graph equal to?

2m

Graph - Dijkstra's Algorithm

A C D E F G B

Consider an adjacency matrix A representing the undirected graph G with no self-edges (edges from a node to itself). Which one of the following statements is not true?

A is an n x m matrix.

In which heap operation is the procedure heapify up used?

Add a new element

Consider a graph G and the tree T produced in a DFS on G starting in a node s? Which of the following is true about T?

All edges in G connect nodes that are ancestors and descendants of each other.

Which secondary data structure can be used?

An array with n elements

Consider the greedy algorithm that solves the minimize lateness problem. Which proof technique is used to prove optimality of the algorithm?

An exchange argument

Consider the proof of optimality of the greedy algorithm that solves the interval scheduling problem. In the last step of the proof, a proof by contradiction is used. Which assumption is made that leads to a contradiction?

Assume that the greedy solution is not optimal.

Algorithm to test bipartiteness in a graph

BFS

We have seen Dijkstra's algorithm solves the problem of finding the shortest paths in a weighted graph. Which algorithm solves this on an unweighted graph?

BFS

Which algorithms can be used to determine strong connectivity for a directed graph?

Breadth-first search or depth-first search

Interval scheduling sort by

Increasing finish time

Consider the greedy algorithm that solves the interval partitioning problem. What order are the intervals selected.

Increasing start time

Consider the problem of finding the minimum spanning tree of a weighted graph G = (V, E). An algorithm starts with the set of nodes V and successively inserts edges from E in order of increasing cost. Any edge that would create a cycle is discarded. What is the name of the algorithm described?

Kruskal's Algorithm

Consider the minimize lateness problem. What is the definition of the lateness l, of a request?

L sub i = max(f sub i - d sub i , 0)

What is the running time that we aim for when implementing the priority queue operations add and delete?

O(log n)

Consider an iterative implementation of breadth-first search and a graph with n nodes and m edges. Which one of the following best describes the running time?

O(m + n)

Consider the adjacency list representation of a graph G with n nodes and m edges. Which one of the following best describes the space requirement of the representation?

O(m + n)

Which one of the following best describes the running time required to test a graph for bipartiteness?

O(m + n)

Consider a greedy algorithm that solves the problem of minding a minimum spanning tree of a graph. Which one of the following best describes the asymptotic running time?

O(m log n)

Consider an iterative implementation of DFS and a graph with n nodes and m edges. Which one of the following describes the number of nodes that will be added to the linear data structure?

O(m)

RT to compute topo order

O(m+n)

What is the running time of the sorting algorithm heapsort?

O(n log n)

Space requirement of adjacency matrix representation?

O(n^2)

Consider the minimize lateness problem and the greedy algorithm that solves it. Which one of the following is not true regarding the schedule produced?

Only requests that meet their deadline have been scheduled.

Consider minimize lateness

Optimal schedule with no inversions and no idle time.

Consider optimal implementation of the greedy algorithm that solves the interval partitioning problem. What data structure is used?

Priority Queue

Consider the optimal implementation of the greedy algorithm that solves the interval partitioning problem. Which data structure is used?

Priority Queue

Which data structure is needed in an efficient implementation of Dijkstra's algorithm?

Priority Queue

Which technique was used to prove that the procedure heapify up restores the heap property when starting with almost a heap?

Proof by induction

Data type to implement BFS

Queue

Let G = (V, E) be an undirected graph and s and t two nodes, such that we have s-t-connectivity in the graph. Call S the set of nodes reachable from s in a breadth-first search. Which one of the following best describes the set of nodes R, reachable from t in a breadth-first search?

R and S contain exactly the same nodes.

Which one of the following graph search implementations does not exist?

Recursive BFS

Method used to compute topological ordering of a DAG?

Recursive procedure

Which one of the following best describes the procedure heapify down?

Recursively moves a too large element downwards by swapping it with its smallest child in the tree, until the heap order is restored

Goal of the interval partitioning problem?

Schedule all requests using as few resources as possible.

Goal of interval scheduling problem?

Schedule as many non-overlapping requests as possible.

Which one of the following operations on a priority queue can be performed in constant time, assuming the best overall implementation?

Select the element with the smallest key

Data type to implement DFS

Stack

Exchange argument proof technique.

Start with an optimal solution.

We are using BFS starting in s to determine s-t connectivity in a graph G. Which one of the following best describes the stop condition?

Stop when t is found or all connected nodes are visited.

Consider the greedy algorithm that solves the interval partitioning problem. Which proof technique was used to prove optimality of the algorithm?

Structural Bound

Which one of the following statements regarding the adjacency matrix and the adjacency list is true?

The adjacency list is a sparse representation of the adjacency matrix.

Assuming the most efficient implementation for each one of the following algorithms, which one has the fastest asymptotic running time?

The algorithms can all be implemented to have the same asymptotic running time

Consider a consecutive inversion, two jobs scheduled as positions i and j with

The new lateness of job i cannot exceed the previous lateness of job j.

Consider the problem of finding the minimum spanning tree of a weighted graph G = (V, E). An algorithm starts with the graph G and removes edges in order of decreasing cost. An edge will not be removed if its removal disconnects the graph. What is the name of the algorithm described?

The reverse-delete algorithm

Consider the proof of optimality for the greedy algo. That solves the interval scheduling problem. The greedy solution A is compared to an optimal solution O. Both are ordered by increasing start and finish times. Wha property

The rth interval in the greedy algorithm has an earlier finish time than the rth interval in the optimal solution.

Which one of the following statements best describes the number of edges in a tree with n nodes?

There are exactly n - 1 edges.

Consider a directed graph. Which one of the following does not imply that the graph is strongly connected?

There is at least one pair of mutually reachable nodes.

Which one of the following statements regarding the optimized algorithm that computes the topo order is not true?

Topo order needs to be unique

Which one of the following PQ operations requires an additional array, besides the array representing the heap?

Update the key of a given element

Which one of the following best describes almost a heap - too big?

We have a heap with the exception of one element that is too big. There is some value beta such that setting the too big value to beta would make the data structure a heap

Consider the problem of finding a MST in a graph.

We use the cut property to show that each addition of an edge in Kruskal's Algorithm is justified.

What can cycle property be used for?

We use the cycle property to show that each removal of an edge in the reverse-delete algo in justified.


Kaugnay na mga set ng pag-aaral

Business Principles Midterm Quizzes

View Set

Fundamental Information Security Chapter 9: Cryptography

View Set

~Module 2, Topic 1: The Highway Transportation System~

View Set