COSC 2336 Final Exam Review (Questions and Answers updated) Already Graded A+100% Excel
COSC 2336 Final Exam Review (Questions and Answers updated) Already Graded A+100% Excel True or False? The Weighted Edge class extends Abstract Graph.Edge. - CORRECT ANSWER-True A Weighted Edge object contains the public data fields _______. - CORRECT ANSWER-u, v, weight The adjacent edge for each vertex in the Weighted Graph class is stored in _________. - CORRECT ANSWER-an Array List The Weighted Graph is a subtype of _________. - CORRECT ANSWER-Graph/Abstract Graph The add Ege (u, v, w) method performs the following operations: - CORRECT ANSWER-Invokes super. add(u, v) to add an edge. Adds a weighed edge to the adjacent list for vertex u. Adds a weighed edge to the adjacent list for vertex v. A hashing function ______. - CORRECT ANSWER-maps a key to an index in the hash table If each key is mapped to a different index in the hash table, it is called _____. - CORRECT ANSWER-perfect hashing A collision occurs _________. - CORRECT ANSWER-when two or more keys are mapped to the same hash value. True or False: Every object has the has Code() method. - CORRECT ANSWER-True What is the return type for the hash Code() method? - CORRECT ANSWER-int True or False: Two objects are equal if their hash Codes are the same. - CORRECT ANSWER-False True or False: Two objects have the same hash Codes if they are equal. - CORRECT ANSWER-True If two strings are equal, the two strings have the same hash Codes. - CORRECT ANSWER-True For an Integer object with value 20, what is its hash Code? - CORRECT ANSWER-20 1<<2 is ______. - CORRECT ANSWER-4 _______ is to find an open location in the hash table in the event of collision. - CORRECT ANSWER-Open addressing When a collision occurs during the insertion of an entry to a hash table, _________ finds the next available location sequentially. - CORRECT ANSWER-linear probing The ______ places all entries with the same hash index into the same location, rather than finding new locations. - CORRECT ANSWER-separate chaining scheme _______ measures how full the hash table is. - CORRECT ANSWER-Load factor _______ finds the next available location quadratically when a collision occurs. - CORRECT ANSWER-Quadratic probing _____ maps a key to an index in a Hash table. - CORRECT ANSWER-Hash Function _____ is to reinsert the elements into the table after the hash table is resized. - CORRECT ANSWER-Rehash _____ is the ration between the number of elements and the ash table size. - CORRECT ANSWER-Load Factor _____ occurs when two keys are mapped to the same index. - CORRECT ANSWER-Collision _____ uses a secondary hashing function along with the primary hash function to find an available location for a key when a collision occurs - CORRECT ANSWER-Double Hashing A ____ is an edge that links to a vertex to itself. - CORRECT ANSWER-loop If two vertices are connected by two or more edges, these edges are called - CORRECT ANSWER-parallel edge A ____ is the one in which every two pairs of vertices are connected - CORRECT ANSWER-complete graph What is the number of edges in a complete graph of n vertices? - CORRECT ANSWER-n(n-1)/2 What is the number of edges in a tree of n vertices? - CORRECT ANSWER-n - 1 ___ is graph in which edges are not weighted - CORRECT ANSWER- Unweighted Graph ____ is an edge that connects to a vertex itself. - CORRECT ANSWER-Loop _____ of G is a sub-graph of G. The sub-graph connects all the vertices in G without cycles. - CORRECT ANSWER-Spanning Tree ____ refers to two or more edges between two vertices. - CORRECT ANSWER-Parallel Edges _____ is a graph that does not have loops or parallel edges. - CORRECT ANSWER-Simple Graph _____ is a graph in which edges have no directions - CORRECT ANSWER-Undirected Graph ____ of a vertex is the number of edges connected to the vertex. - CORRECT ANSWER-Degree ___ refers to a closed path in a graph. - CORRECT ANSWER-Cycle ____ of G is a graph whose vertices is a subset of the vertices in G and edges are subset of edges in G. - CORRECT ANSWER-Sub-graph ____ is a graph in which there is an edge between any pair of vertices. - CORRECT ANSWER-Complete Graph The _____ search of a graph first visits a vertex, then it recursively visits all the vertices adjacent to that vertex. - CORRECT ANSWER-depth-first True of False: The time complexity of the DFS algorithm is O(|E|+|V|). - CORRECT ANSWER-True The ____ search of a graph first visits a vertex, then all its adjacent vertices, then all the vertices adjacent to those vertices and so on. - CORRECT ANSWER-breadth-first True or False: The time complexity of the BFS algorithm is O(|E|+|V|), - CORRECT ANSWER-True True or false: The WeightedEdge class extends AbstractGraph Edge - CORRECT ANSWER-True A WeightedEdge object contains the public data fields ______. - CORRECT ANSWER-u,v,weight The adjacent edge for each vertex in the WeightedGraph class is stored in____ - CORRECT ANSWER-an ArrayList The WeightedGraph is a subtype of ____. - CORRECT ANSWER-Abstract Graph and Graph The addEdge(u,v,w) method performs the following operations: - CORRECT ANSWER-Invokes (u,v) to add an edge. Adds a weighted edge to the adjacent list ofr vertex u.
Written for
- Institution
- COSC 2336
- Course
- COSC 2336
Document information
- Uploaded on
- May 28, 2024
- Number of pages
- 21
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cosc 2336 final exam review questions and answers