@@ -541,103 +541,13 @@ record convenient information such as the list length, but it's not strictly nec
541541
542542.. _linked_list_dia :
543543
544- .. graphviz ::
545- :caption: Diagram of a linked list. A new link containing the value `F ` is
546- being inserted between the link with value `C ` and that with value `D `.
547- :align: center
548- :class: textheight
549-
550- digraph ll {
551- bgcolor="#ffffff00"
552- graph [
553- rankdir = "TB"
554- ];
555- node [
556- fontsize = "16"
557- ];
558- edge [
559- ];
560-
561- subgraph cluster_1 {
562- style="ellipse, dashed";
563- bgcolor="lightgray";
564-
565- "node_init" [
566- label = "<f0> A| next| 1 <f1>"
567- shape = "record"
568- ];
569-
570- "node0" [
571- label = "<f0> B| next| 1 <f1>"
572- shape = "record"
573- ];
574-
575- "node1" [
576- label = "<f0> C| next| 1 <f1>"
577- shape = "record"
578- ];
579-
580- "node2" [
581- label = "<f0> D| next| 1 <f1>"
582- shape = "record"
583- ];
584-
585- "node3" [
586- label = "<f0> E| next| 1 <f1>"
587- shape = "record"
588- ];
589-
590- "node4" [
591- label = "None"
592- shape = "record"
593- ];
594-
595-
596-
597- subgraph cluster_2 {
598- style="ellipse, dashed";
599- bgcolor="#2E8B57";
600-
601- "node5" [
602- label = "<f0> F| next|_ <f1>"
603- shape = "record"
604- ];
605- }
606-
607- "node_init":f1 -> "node0":f0 [
608- id = 0
609- ];
610-
611- "node0":f1 -> "node1":f0 [
612- id = 1
613- ];
614-
615- "node1":f1 -> "node2":f0 [
616- id = 2
617- label ="old link"
618- ];
619-
620- "node2":f1 -> "node3":f0 [
621- id = 3
622- ];
623-
624- "node1":f1 -> "node5":f0 [
625- id = 4
626- label =" new link"
627- style= "dashed"
628- ];
629-
630- "node5":f1 -> "node2":f0 [
631- id = 5
632- style= "dashed"
633- ];
634-
635- "node3":f1 -> "node4":f1 [
636- id = 6
637- style = dashed
638- ];
639- }
640- }
544+ .. figure :: images/linked_list.*
545+
546+ Diagram of a linked list. A new link containing the value `E ` is
547+ inserted between the link with value `B ` and that with value `C `. First,
548+ the link reference from `E ` is pointed to `C ` (blue dashed line). Next,
549+ the link reference from `B ` is pointed to `E ` (red dotted line).
550+
641551
642552.. code-block :: python3
643553 :caption: A simple singly linked list implementation.
0 commit comments