CS 361 Final Review

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Turing Machine

- is similar to a finite automaton with supply of unlimited memory - can do everything that any computing device can do. * - is a theoretical machine, can be implemented by a computer - is basically an algorithm - is a special machine that solves one specific problem

True

T/F An undirected, connected, and weighted graph may have more than one Minimum Spanning Tree (MST)

True

T/F Any language accepted by a DFA can also be accepted by a NFA.

True

T/F Both merge sort and quick sort are defined recursively.

True

T/F By using Merge Sort, we can sort √n elements in O(√nlogn).

False

T/F Divide and conquer is an effective sorting algorithm, not really a general problem solving strategy.

True

T/F Every NFA has an equivalent DFA, and every DFA has an equivalent NFA.

True

T/F For T(n) = 4nˆ2 - 2n - 1 - O(nˆ2) is true for c =4 and n0 = 1

True

T/F For T(n) = 4nˆ2 - 2n - 1 = O(nˆ2) is true for c=4 and n0 = 1

True

T/F For a connected undirected graph G = (V,E), its Breadth-First Tree has |V| -1 edges.

False

T/F For connected undirected graph G = (V,E), its Breadth-First Tree and Depth-First Search forest should always be the same.

False

T/F If a DFA has n states, it cannot accept strings with a length greater than nˆ2.

True

T/F If f(n) = O(nˆ6) and f(n) = Ω(nˆ6) then f(n) = Θ(nˆ6)

True

T/F If f(n) = O(nˆ6) then f(n) = O(nˆ6 log n).

True

T/F If f(n) = O(nˆ6), then f(n) = O (nˆ6 log n).

False

T/F If machine M has two input symbols that transit to q2 from q1, then M cannot be a DFA.

True

T/F If p = <v1, v2, ..., vk> is a shortest path from v1 to vk, 1 ≤ i ≤ j ≤ k, and pij = < vi, vi+1, ..., vj> be the sub-path of p from vi to vj then, pij is a shortest path from vi to vj.

False

T/F In a connected graph G=(V,E), |V| > |E| is always true

True

T/F In class we introduced at least two algorithms to find the single-source shortest-paths

True

T/F In class we stated that the merge sort has the best time complexity for comparison based sorting algorithms

True

T/F Kruskal and Prim algorithm is finding a MST are examples of Greedy algorithms

True

T/F Let's A, p, and s be defined as in the Pumping Lemma, if s = xyz, then s'= xz must also be in A.

False

T/F Like Merge sort, topological sort can sort n elements in O(nlog n) time

True

T/F Merge sort has its best case time complexity the same as its worst case time complexity, which is O(n log n)

False

T/F Merge sort is an example of divide and conquer, quick sort is not.

False

T/F Neither Bellman-Ford's nor Dijkstra's single-source shortest-paths algorithm allows negative edges

True

T/F Not all languages over the alphabet of {0, 1} is regular, explain.

False

T/F Problems that can be solved by Dynamic Programming can also be solved with a Greedy algorithm

False

T/F Pumping Lemma is mostly used to prove that a language is actually regular.

False

T/F Quick sort has its best case time complexity the same as its worst case time complexity, which is O(n log n).

False

T/F Quicksort is an excellent example for greedy algorithms.

False

T/F Since Merge sort is the best comparison based algorithm and is O(n*log n), Radix sort cannot be faster than that.

False

T/F The 0-1 Knapsack Problem has a dynamic programming solution as well as a greedy algorithm solution

True

T/F The Bellman-Ford single-source shortest-paths algorithm is O(|v|3).

False

T/F The Master Theorem has three cases and it covers all possible recurrence situations.

True

T/F The class of regular language is closed under the union operation.

False

T/F The set of states Q in a DFA can be empty.

False

T/F The shortest path of a graph forms a tree and the tree is always unique

True

T/F Topologic sort can only be performed on DAGs, and the results on the same graph can be different

False

T/F We cannot use Radix sort to sort strings.

True

T/F f(n) = Ω(g(n)) if Ǝ positive constants c and n0 such that 0 ≤ c•g(n) ≤ f(n) ∀ n ≥ n0

O(n log n)

Complexity of Merge Sort

True

T/F According to Parenthesis Theorem of DFS, two vertices do not have to be in the same tree

No

If the array is already sorted, will that affect the average case complexity (yes or no)

True

T/F A = {0ˆi 1ˆj |i > j} is not regular.

False

T/F A NFA can have more than one state as the start state, a DFA can only have one state as the start state.

False

T/F A NFA is considered as a special case of a DFA.

True

T/F A relaxation step may decrease the value of the shortest-path cost d[v] and update v's predecessor π[v].

False

T/F Adjacency Matrix cannot be used to represent a DAG


Set pelajaran terkait

The Westward Movement History Test Part 1

View Set

NEUROLOGICAL DISORDERS OF THE ADULT PT--NCLEX REVIEW

View Set

History Quest The Industrial Revolution - Short answers

View Set

Словарь терминов по истории России, необходимых для выполнения заданий ЕГЭ

View Set

Week 5: Consumer Behavior, Cultural/Social/Personal Factors

View Set

Quantitative, Qualitative, & Mixed Methods Inquiry

View Set