Image a graph. In which instances is it more appropriate to use an adjacency list instead of an adjacency matrix?

There are two criteria that usually determine whether we use an adjacency list or an adjacency matrix?a. The size of the graph and the number of edges. If the graph has a very big number of nodes but has only a small amount of edges, then we are faced with what we call a 'sparse' graph. Using an adjacency list would save a lot of space, because it would not allocate space for non-existing edges, just as an adjacency matrix would do.b. How many accesses we want to make using the representation. An adjacency matrix has the benefit that every access is O(1), while an adjacency list usually requires parsing through the elements before we reach the desired nodes. So in the case in which we only do a small number of accesses, again for the benefit of saving space, we can use an adjacency list.

Answered by Calin B. Computing tutor

1355 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Write a function in pseudocode that determines if a given string is a palindrome


How is different an NFA from a DFA?


Explain indexed addressing including the benefits when traversing certain data structures (4 Marks)


Give two types of management of either hardware or other resources that are performed by an operating system.


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences