Data structure

259 views
195 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
259
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Data structure

  1. 1. Topological Sort ?-it is ordering of vertices in a directed acyclic group .If its path vi to vj then vj appears after vi in the ordering Topological ordering is not possible if the graph has acyclic ?. E.g: v1 v2 v3 v4 v5 v6 v7
  2. 2. Algorithm for topologies : • Create an array of length equal to the number of vertices.• While the number of vertices is greater than 0, repeat:. :• Find a vertex with no incoming edges (“no prerequisites”). . • Put this vertex in the array. .•Note that this destructively updates a graph; often this is a bad idea, so make a copy of the graph first and do topological sort on the copy.
  3. 3. Topological Sort Algorithm The Topological sort algorithm is:int topologicalOrderTraversal( ){ int numVisitedVertices = 0; while(there are more vertices to be visited){ if(there is no vertex with in-degree 0) break; else{ select a vertex v that has in-degree 0; visit v; numVisitedVertices++; delete v and all its emanating edges; } } return numVisitedVertices;}
  4. 4. Just we take this example 4 solve topological graph Here a=0 because in degree is 4 ‘a’
  5. 5. Graph 1vertex A B C D E F G HA 0 1 1 0 1 0 0 0B 0 0 0 0 0 1 0 0C 0 0 0 1 0 1 1 0D 0 1 0 0 1 0 0 1E 0 0 0 0 0 1 0 0F 0 0 0 0 0 0 0 1G 0 0 0 0 1 0 0 1h 0 0 0 0 0 0 0 0Sum 0 2 1 1 3 3 1 3ofcolum
  6. 6. • Overview– Terms• Topics– Ethernet-Standard– Network topologies• Bus topology• Ring topology• Star topology• Fully connected topology• Mesh topology– IPv4 & IPv6
  7. 7. • Prototype of the Ethernet Standard• Characteristics:– A central cable (coaxial cable)– Lines to the attached stations– Decentralized structure (stations with equal standing)– All attached stations are affected by disturbance at the centralcable
  8. 8. RING Topology• One token "moves" in the circle (Ringstructure of the network)• If the token is "free", then the stationcan attach a network package RING TYPE

×