Skip to content

COSC3020/graph-representations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Graph Representations

Implement a function that converts an adjacency matrix to an adjacency list for a directed unweighted graph using the template in code.js. Test your new function; I've provided some basic testing code that uses jsverify in code.test.js. Now, the test code does contain the solution, so you can have a look at it if you get stuck, but try not to peek before attempting to solve it on your own.

Runtime Analysis

What is the runtime complexity of the conversion that you implemented? Does it depend on the number of vertices, the number of edges, or both?

Describe your reasoning and the conclusion you've come to. Your reasoning is the most important part. Add your answer to this markdown file.

Bonus

Implement a function to convert an adjacency list to an adjacency matrix and analyze it as above.