Please fill out this quiz, and press the "Submit" button at the end. Don't collaborate with anyone on quiz exercise solutions.
Please answer all questions.
SID: [No spaces and no dashes.]
Login ID :
1. Let G be an undirected graph with n vertices and m edges. Let v be a vertex in G, and let k denote the number of neighbors of v (i.e., the number of nodes connected to v by some edge).
(a) What is the running time to count how many neighbors v has, if the graph is represented using an adjacency matrix? Express your answer as a function of k,n,m, using Theta notation. Explain your answer briefly.
(b) What is the running time to count how many neighbors v has, if the graph is represented using adjacency lists? Express your answer as a function of k,n,m, using Theta notation. Explain your answer briefly.
(a) What is the largest that m could be, as a function of n?
(b) Suppose G is made up of a single connected component. What is the smallest that m could be, as a function of n?