logo

Assignment On Edward Aboagye.

Deciding the best data structure to store flight information and explaining its implementation and storage using diagrams.

8 Pages1351 Words11 Views
   

Added on  2022-10-04

Assignment On Edward Aboagye.

Deciding the best data structure to store flight information and explaining its implementation and storage using diagrams.

   Added on 2022-10-04

ShareRelated Documents
Edward Aboagye
P16150395
Question 1
a) Graph Data Structure
For this question I will be using graph data structure. Data structures comprises of vertices and
edges. Edges connects vertices through lines. If two vertices are connected by an edge then it is
termed as adjacent matrix. In this case A and B are both connected to two certain edges, and
vertex D is not connected with any other vertex and F can also be connected to its own vertex.
Adjacency List: Every vertex on the diagram is recorded in an item as keys, these keys are
related to a sum of vertices, which sends information towards the connected edges that every
vertex has. This strategy is commonly known as putting away the rundown of edges. Along these
lines, extra data can be put away on the vertices and edges. A diagram may contain only one
edge between two hubs, or it may contain two: one from the first to the second, and one again
from the second to the first (with each edge related with its own worth). A coordinated diagram
is pitifully symmetric on the off chance that when there is an edge from node1 to node2, at that
point there additionally is an edge from node2 to node1; similarly, a coordinated chart is
emphatically symmetric on the off chance that when there is an edge from node1 to node2, at
that point there likewise is an edge from node2 to node1 with the related qualities for these edges
equivalent(Kabiljo, Dhulipala, Shalita, Sharma, Karrer, & Facebook Inc, 2017).
Assignment On Edward Aboagye._1
Edward Aboagye
P16150395
b) Storing of information in adjacency list matrix
Each row and column in the table below corresponds to vertex. Diagrams comprise of an
accumulation of hubs (otherwise known as vertices), each with a mark it is known by. Edges
(otherwise known as circular segments) happen between pair of hubs, and each edge can have a
related worth (used to encode an assortment of data: regularly a number, for the length of the
edge, the expense of the edge, and so forth). In a coordinated chart (otherwise known as digraph,
the thoughtful we will consider), edges have a recognizable source and goal hub; an edge is
composed as a bolt from its cause to its goal(Ainsworth, Jones, 2016, June).
Assignment On Edward Aboagye._2
Edward Aboagye
P16150395
For the table above, we have 6 different cities and 9 separate flights.
Here is another example of adjacency list matrix
The diagram above has 8 cities and 12 separate flights.
Assignment On Edward Aboagye._3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Assignment | An edge-weighted digraph is a digraph where we associate weights
|7
|1444
|18