ДАВАЙ

Ace your homework & exams now with Quizwiz!

Question text Which of the following is a characteristic of a Minimum Spanning Tree (MST) in a connected undirected graph?

. It connects all nodes with the lowest possible total edge weight.

What is the time complexity of a brute-force solution to the Knapsack Problem?

. O(2^n)

In a greedy algorithm, what happens to an item if the current solution set is not feasible after adding the item?

. The item is rejected and never considered again.

In the context of greedy algorithms, what is the 'solution set'?

A set containing the answersbuilt incrementally.

Which of the following data structures allow duplicate values?

Array Linked List

Which of the following notations is emphasized in the first course for analyzing algorithm performance? a. Asymptotic (Big-oh) Notation b. Permutation and Combination c. Master Method d. Probability and Statistics

Asymptotic (Big-oh) Notation

Which scenario exemplifies the greedy choice property?

At each step, choosing the option that seems best in that moment.

Which step is not part of the process in a greedy algorithm approach?

Backtracking to the previous decision if it was wrong.

Which of these is not a step in the execution of a greedy algorithm?

Consider the global optimal solution at each step.

When applying Kruskal's algorithm, the data structure commonly used to detect and avoid cycles is:

Disjoint set

The Master Method is used to analyze the running time of which type of algorithms? a. Greedy algorithms b. Dynamic Programming c. Backtracking algorithms d. Divide and Conquer

Divide and Conquer

Which of the following is a characteristic of a Minimum Spanning Tree (MST) in a connected undirected graph?

It connects all nodes with the lowest possible total edge weight.

What is the time complexity of Kruskal's algorithm in terms of the number of edges (E) and vertices (V)?

O(E log V)

What is the time complexity of Kruskal's algorithm in terms of the number of edges (E) and vertices (V)? a. O(V^2) b. O(V log V) c. O(EV) d. O(E log V)

O(E log V)

What is the time complexity of Kruskal's algorithm?

O(E log V)

What is the typical time complexity of the Bellman-Ford algorithm?

O(V*E) where V is the number of vertices and E is the number of edges

What is the typical approach of a greedy algorithm when confronted with multiple choices at a step?

Picks the choice that looks best at that moment.

Which algorithm is typically faster for dense graphs with lots of edges?

Prim's Kruskal's algorithm runs faster in sparse graphs.

Which of the following algorithms is used to find the minimum spanning tree in a graph? a. Dijkstra's Algorithm b. Prim's Algorithm c. Breadth-First Search d. Kruskal's Algorithm

Prim's Algorithm

Prim's algorithm is a modified version of which other well-known algorithm?

Prim's algorithm is a modified version of Dijkstra's algorithm.

In Prim's algorithm, what structure is used to select the next node with the lowest weight edge?

Priority queue

The principle of a greedy algorithm can be best described as which of the following?

Short-sighted and non-revisiting.

What is the main idea behind Kruskal's algorithm for finding the MST?

Sorting edges based on their weight and selecting the shortest ones without forming a cycle.

What is a distinguishing factor when choosing between Prim's and Kruskal's algorithms?

The density of the graph.

What property do both Prim's and Kruskal's algorithms share?

They both find a minimum spanning tree.

Which of the following is a characteristic of randomized algorithms?

They can provide good performance with a high probability

Which of these problems is a famous example of an NP-complete problem?

Travelling Salesman Problem

In a greedy algorithm, when is an item added to the solution set rejected?

When it makes the solution set infeasible.

In a greedy algorithm, when is an item added to the solution set rejected? с

When it makes the solution set infeasible.

How does a greedy algorithm typically start a problem-solving session?

With an empty solution set.

You in a graph theory, what is an edge ? a) a connection between two vertices b) the longest path in a graph c) a vertex in a graph d) the shortest path in a graph

a) a connection between two vertices

In the context of algorithms, what does the Master Method help with? a. Analyzing the running time of divide and conquer algorithms b. None of the above c. Finding the optimal solution to a problem d. Generating random input data for testing

a. Analyzing the running time of divide and conquer algorithms

In a heap, where is the smallest (min-heap) or largest (max-heap) element found? a. At the root b. In the middle c. At the leaf nodes d. At any random node

a. At the root

Which of the following algorithms are known for finding the shortest path in a graph? a. Bellman-Ford Algorithm b. Dijkstra's Algorithm c. Bubble Sort d. Quick Sort

a. Bellman-Ford Algorithm b. Dijkstra's Algorithm

Which of the following topics is covered under the Sorting and Searching section? a. Data structuring b. Optimal solution finding c. Large integers multiplication d. Randomized input generation

a. Data structuring

In algorithm analysis, what does the term 'asymptotic' refer to? a. Describing the behavior of an algorithm as the input size approaches infinity b. Describing the memory usage of an algorithm c. Describing the optimality of an algorithm d. Describing the exact runtime of an algorithm for small inputs

a. Describing the behavior of an algorithm as the input size approaches infinity

Which of the following is a characteristic of a binary tree? a. Each node has at most two children b. Each node has a fixed number of children c. Each node has an arbitrary number of children d. Each node has at most three children

a. Each node has at most two children

What problem does the Contraction Algorithm for Min Cuts solve? a. Finding minimum cuts in a graph b. Sorting an array of numbers c. Breaking down a problem into subproblems d. Searching an element in a data structure

a. Finding minimum cuts in a graph

Which of the following data structures are commonly used in algorithms for finding shortest paths? a. Heap b. Graph c. Queue d. Array

a. Heap c. Queue

Which of the following data structures is a type of associative container? a. Map b. Queue c. Stack d. Array

a. Map

The first course covers which of the following algorithm analysis methods? a. Master Method b. Greedy Method c. Asymptotic (Big-oh) Notation d. Dynamic Programming Method

a. Master Method (maybe) c. Asymptotic (Big-oh) Notation

Which of the following algorithms can be used to detect cycles in a graph? a. Depth-First Search b. Quick Sort c. Bubble Sort d. Union-Find

a. Depth-First Search

A greedy algorithm is said to have which of the following properties if it can make a choice that seems the best at the moment without considering the larger problem?

a. Greedy Choice Property

What does it mean for an algorithm to be "exact" in the context of NP-complete problems?

a. It always finds the optimal solution

Local search algorithms for NP-complete problems are particularly good for what kind of instances?

a. Large instances where exact algorithms are too slow

What is the primary focus of a greedy algorithm at each step?

a. Local optimality

The first course covers which of the following sorting algorithms? a. Merge Sort b. Bubble Sort c. Selection Sort d. QuickSort

a. Merge Sort d. QuickSort

Which of the following algorithms is used to find the minimum spanning tree in a graph? a. Prim's Algorithm b. Kruskal's Algorithm c. Breadth-First Search d. Dijkstra's Algorithm

a. Prim's Algorithm b) Kruskal's Algorithm

Which of the following are essential for implementing a Depth-First Search algorithm? a. Stack b. Graph c. Queue d. Array

a. Stack b. Graph

Which of the following are characteristics of a hash table? a.Fast access time b.Slow insertion time c.Key-value pairs d.Ordered data

a.Fast access time c.Key-value pairs

Which of the following algorithms are used for searching in a graph? a. Merge Sort b. Breadth-First Search c. Depth-First Search d. Bubble Sort

b) Breadth-First Search c) Depth-First Search

Which of the following data structures are commonly used in algorithms for finding shortest paths? a. Array b. Graph c. Queue d. Heap

b) Graph d) Heap

In a graph, what is a vertex? a. The shortest path in the graph b. A point where edges meet c. The edge connecting two nodes d. The longest path in the graph

b. A point where edges meet

In a graph, what is a vertex? a. The shortest path in the graph b. A point where edges meet c. The edge connecting two nodes d. The longest path in the graph 2

b. A point where edges meet

The first course covers which of the following algorithm analysis methods? a. Dynamic Programming Method b. Asymptotic (Big-oh) Notation c. Master Method d. Greedy Method

b. Asymptotic (Big-oh) Notation

The first course discusses algorithms for solving which of the following problems? a. Travelling Salesman Problem b. Closest Pair Problem c. Integer and Matrix Multiplication d. Knapsack Problem

b. Closest Pair Problem c. Integer and Matrix Multiplication

Which data structure is often used to implement a Priority Queue? a. Linked List b. Heap c. Array d. Stack

b. Heap

What is the primary characteristic of asymptotic notation?

b. It describes the behavior of algorithms as the input size grows

Which of the following is a type of algorithm discussed in the Divide and Conquer section of the course? a. Heap Sort b. Merge Sort c. Bubble Sort d. Selection Sort

b. Merge Sort

What is a distinguishing factor when choosing between Prim's and Kruskal's algorithms? a. The algorithm's complexity. b. The density of the graph. c. The total weight of the graph. d. The number of nodes.

b. The density of the graph.

Which algorithm can be used to find the total cost of searches in an Optimal Binary Search Tree?

b. Dynamic programming

Which of the following algorithms are used for network flow problems? a. Quick Sort b. Edmonds-Karp Algorithm c. Bubble Sort d. Ford-Fulkerson Algorithm

b. Edmonds-Karp Algorithm and d. Ford-Fulkerson Algorithm

What is the primary significance of the class P in computational complexity?

b. It contains problems that can be solved in polynomial time.

What is the primary characteristic of asymptotic notation? a. It describes the optimality of algorithms b. It describes the behavior of algorithms as the input size grows c. It describes the space complexity of algorithms d. It describes the exact runtime of algorithms

b. It describes the behavior of algorithms as the input size grows.

Which of the following is a characteristic of randomized algorithms? a. They guarantee the optimal solution b. They can provide good performance with a high probability c. They have a fixed running time d. They require additional memory

b. They can provide good performance with a high probability

Question text Why are faster exact algorithms for NP-complete problems important?

b. They can solve problems exactly in less time for certain instances

Why are faster exact algorithms for NP-complete problems important?

b. They can solve problems exactly in less time for certain instances.

What is the goal when solving the Optimal Binary Search Tree problem using dynamic programming?

b. To minimize the expected search cost.

Which of the following are considered as dynamic data structures? a. Array b. Tree c. Linked List d. Hash Table with fixed size

b. Tree c. Linked List

if an optimal solution of a problem contains the optimal solutions to the subproblems which property does the problem have a) dynamic programming b) divide and conquer c) Optional substructure d) greedy choice property

c) Optional substructure

Which of the following mathematical notations is covered in the course? a. Probability and Statistics b. Matrix Algebra c. Asymptotic (Big-oh) Notation d. Permutation and Combination

c. Asymptotic (Big-oh) Notation

Which of the following notations is emphasized in the first course for analyzing algorithm performance? a. Master Method b. Probability and Statistics c. Asymptotic (Big-oh) Notation d. Permutation and Combination

c. Asymptotic (Big-oh) Notation

Which of the following algorithms is not a sorting algorithm? a. Bubble Sort b. Quick Sort c. Breadth-First Search d. Merge Sort

c. Breadth-First Search

Divide and Conquer algorithms characteristically involve? a. Having a fixed running time b. Guaranteeing the optimal solution c. Breaking the problem into smaller subproblems d. Solving subproblems independently

c. Breaking the problem into smaller subproblems

The Randomized Algorithms section of the first course discusses which of the following algorithms? a. Insertion Sort b. Bubble Sort c. Contraction Algorithm for Min Cuts d. QuickSort

c. Contraction Algorithm for Min Cuts d. QuickSort

Which algorithmic strategy does the Master Method relate to? a. Sequential Algorithms b. Sorting and Searching c. Divide and Conquer d. Randomized Algorithms

c. Divide and Conquer

Which of the following are common characteristics of a graph?

c. Edges d. Vertices

Which of the following is a common sorting algorithm? a. Quick Cut b. Big-Oh Sort c. Merge Sort d. Divide Sort

c. Merge Sort

The QuickSort algorithm is a type of: a. Dynamic Programming b. Sequential Algorithm c. Randomized Algorithm d. Iterative Algorithm

c. Randomized Algorithm

What does the Master Method help in analyzing? a. The optimality of algorithms b. The correctness of algorithms c. The running time of Divide and Conquer algorithms d. The space complexity of algorithms

c. The running time of Divide and Conquer algorithms

What is the primary purpose of a hash table? a. Data serialization b. Data compression c. Fast data retrieval d. Data sorting

c. Fast data retrieval

Which of the following data structures are commonly used for dictionary operations? a. Stack b. Array c. Hash Table d. Binary Search Tree

c. Hash Table and d. Binary Search Tree.

Which algorithmic concept is essential for coping with computationally intractable problems?

c. Heuristic

What does it mean if a problem is NP-hard?

c. It is at least as hard as the hardest problems in NP.

What is the time complexity of deleting a node in a linked list? a. O(n) b. O(n log n) c. O(1) d. O(log n)

c. O(1)

Why are local search algorithms used for NP-complete problems?

c. They can often find good solutions quickly for large instances

What is the base case in a recursive algorithm? a. A condition that optimizes the recursion b. A condition that initiates the recursion c. A condition that loops the recursion d. A condition that allows the recursion to stop

d. A condition that allows the recursion to stop

Which of the following is a type of balanced binary tree? a. Binary Heap b. B-tree c. Trie d. AVL Tree

d. AVL Tree

Which data structure is ideal for representing a Graph? a. Stack b. Queue c. Array d. Adjacency List

d. Adjacency List

What data structure is commonly used in Kruskal's algorithm to check for cycles?

d. Disjoint set

When applying Kruskal's algorithm, what data structure is commonly used to detect and avoid cycles?

d. Disjoint set

Which of the following is a characteristic of a hash table? a. Slow insertion time b. Ordered data c. Slow deletion time d. Fast access time

d. Fast access time

In the context of the course, what does the Closest Pair Problem refer to? a. Finding the pair of elements in an array that have the smallest difference b. Finding the pair of elements in an array that sum to a target value c. Finding the shortest path between two nodes in a graph d. Finding two points in a plane that are closest to each other

d. Finding two points in a plane that are closest to each other

Which of the following is a topic covered in the Randomized Algorithms section of the course? a. Bubble Sort b. Selection Sort c. Insertion Sort d. QuickSort

d. QuickSort

r Which of the following is a characteristic of a Minimum Spanning Tree (MST) in a connected undirected graph?

d. It connects all nodes with the lowest possible total edge weight.

e What is the typical approach of a greedy algorithm when confronted with multiple choices at a step?

d. Picks the choice that looks best at that moment.

What is a reduction in the context of computational complexity?

d. Transforming one problem into another to prove complexity

r How does a greedy algorithm typically start a problem-solving session?

d. With an empty solution set.


Related study sets

General Insurance - AR Life Insurance

View Set

Consent with Subjects Who Do Not Speak English CITI Program

View Set

Management of Patients With Complications from Heart Disease

View Set

Anatomy 1 intro to skeletal system and parts of a long bone

View Set