A doubly linked list has n nodes with data and two pointers, previous and next, to other nodes…
A doubly linked list has n nodes with data and two pointers, previous and next, to other nodes (or null). (See Figure 11.17 for an example.) Let Cn denote an n-node doubly linked list with nodes {1, 2, . . . , n}, where, for each node u,
• u’s next node is v = (u mod n) + 1
• v’s previous node is u
Define a directed graph Gn = hV, Ei, where V is the set {1, 2, . . . , n} of nodes, and every node has two edges leaving it: one edge hu, u.nexti, and one edge hu, u.previousi.
1.Draw G5.
2.Give an example of a Gn that contains a self-loop.
3.Give an example of a Gn that contains parallel edges.