February 2020
Beginner to intermediate
616 pages
15h 16m
English
After entering all of the edges along with their weights, the adjacency list has to be displayed. To do this, a temp1 pointer is set to point to startList. A while loop will execute until the temp1 pointer reaches NULL. So, the temp1 pointer will point to vertex 1 initially. Thereafter, by taking the help of the second pointer, temp2, all the edges of the temp1 pointer (that is, vertex 1) are accessed and displayed on screen. After displaying all the edges of vertex 1, by making use of the vrt member, the temp1 pointer is set to point to the next vertex, that is, to vertex 2. Again, the temp2 pointer is set to point at vertex 2, and, using its edg member, all the edges of vertex 2 are displayed. The procedure ...
Read now
Unlock full access