Question

CS 3345: Data Structures and Algorithms -Homework 7 1. These three questions about graphs all have the same subparts. Note that for parts (iii), (iv), and (v), your answer should be in terms of an arbitrary k, not assuming k-4 a) Suppose a directed graph has k nodes, where there are two lspecial nodes. One has an edge from itself to every non-special node and the other has an edge from every non-special node to itself. There are no other edges at all in the graph. i. Draw the graph (using circles and arrows) assuming k-4 ii. Draw an adjacency list representation of the graph assuming k ii. In terms of k, exactly how many edges are in the graph? iv. Is this graph dense or sparse? v. In terms ofk (if k is relevant), exactly how many correct results for topological sort that does this graph have? b) Suppose a directed graph has k nodes, where each node corresponds to a number (1, 2, ..., k) and there is an edge from node i to node j if and only if i mod 2 6-j mod 2 i. Draw the graph (using circles and arrows) assuming k-4 ii. Draw an adjacency list representation of the graph assuming k-4 ii. In terms ofk exactly how many edges are in the graph assuming k is even? Is this graph dense or sparse? In terms ofk (if k is relevant), exactly how many correct results for topological sort that does this graph have? iv. v. c) Suppose a directed graph has k nodes, where each node corresponds to a number (1, 2, ..., k) and there is an edge from node i to node j if and only ifj-i+1 i. Draw the graph (using circles and arrows) assuming k-4 ii. Draw an adjacency list representation of the graph assuming k ii. In terms of k, exactly how many edges are in the graph? iv. Is this graph dense or sparse? v. In terms ofk (if k is relevant), exactly how many correct results for topological sort that does this graph have?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: Note: I have answered for part A and B only. A) The following directed graph has k nodes as represents D Draw the graiv) From the following graph, it represent as dense graph because it has maximum number of edges. v) In terms of K, the numbeNodes iii) As the given K vertices there will be K-1 edges in the graph, in order to consider all possible edges in the above

Add a comment
Know the answer?
Add Answer to:
CS 3345: Data Structures and Algorithms -Homework 7 1. These three questions about graphs all have...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. You will be asked questions about graphs. The graphs are provided formally. To answers the...

    1. You will be asked questions about graphs. The graphs are provided formally. To answers the questions, it may help to draw the graphs on a separate sheet. a Consider the graph (V, E), V = {a,b,c,d) and E = {{a,d}, {b,d}, {c, d}}. This graph is directed/undirected This graph is a tree y/n. If yes, the leafs are: This graph is bipartite y/n. If yes, the partitions are: a, d, b, c is/is not a path in this graph....

  • In this question, we will think about how to answer shortest path problems where we have more than just a single sourc...

    In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...

  • In this question, we will think about how to answer shortest path problems where we have more than just a single sourc...

    In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT