Quiz-02-midterm-2

.pdf
School
University of British Columbia**We aren't endorsed by this school
Course
COSC 221
Subject
Computer Science
Date
Dec 18, 2024
Pages
3
Uploaded by HighnessWolfPerson870
Quiz-02 - Midterm 2Basic Algorithms And Data Structures (The University of British Columbia)Scan to open on StudocuStudocu is not sponsored or endorsed by any college or universityQuiz-02 - Midterm 2Basic Algorithms And Data Structures (The University of British Columbia)Scan to open on StudocuStudocu is not sponsored or endorsed by any college or universityDownloaded by utu tutyu (Kiana.nazem.b@gmail.com)lOMoARcPSD|47330067
Background image
(COSC 221 Quiz 02)(UBCO, Friday, November 20, 2020)Student Name:Student ID:Question 1. (5 points, 1 point for each) True/False Questions1.1) In a simple graph onnvertices, the degree of a vertex is at mostn-1.TrueFalse1.2) A complete graph on 5 vertices has 20 edges.TrueFalse1.3) A graph onnvertices withn-1 must be a tree.TrueFalse1.4) Every graph has a spanning tree.TrueFalse1.5) A connected component of an acyclic graph is a tree.TrueFalseQuestion 2. (15 points) Answer the Following Questions2.1)................................................................................/5 pointsDraw all the induced subgraphs on two or more vertices of the following graph.1Downloaded by utu tutyu (Kiana.nazem.b@gmail.com)lOMoARcPSD|47330067
Background image
Quiz 02: COSC 221, UBCO (Page 2)2.3)................................................................................./4 pointsConsider a simple graphG(V,E) whereV={v1,v2,v3,v4,v5,v6}andE={{v1,v6},{v2,v3},{v3,v4},{v4,v2}}.How many connected components are there in this graph?2.4)................................................................................./3 pointsWhat is the number of edges in an undirected graph on 20 vertices with the average vertex degree 5?2.5) Trees.........................................................................../3 pointsLetTbe a tree onnvertices, and suppose that the degree of one of the vertices isn-1.How many leaves doesThave? Please explain your answer.2Downloaded by utu tutyu (Kiana.nazem.b@gmail.com)lOMoARcPSD|47330067
Background image