Changed URL for Diagrams to Satisfy CORS (#3062)

URL change for the linked list diagrams.
This commit is contained in:
BethanyG
2022-05-23 14:08:21 -07:00
committed by GitHub
parent 9072c32aa3
commit 62874a50ea

View File

@@ -4,12 +4,12 @@
While `stacks` and `queues` can be implemented using `lists`, `collections.deque`, `queue.LifoQueue`, and `multiprocessing.Queue`, this exercise expects a ["Last in, First Out" (`LIFO`) stack][Baeldung: The Stack Data Structure] (_interactive example [here][LIFO Stack]_) using a _custom-made_ [singly linked list][singly linked list].
![Diagram representing a stack implemented with a linked list. A circle with a dashed border named New_Node is to the far left-hand side, with two dotted arrow lines pointing right-ward. New_Node reads "(becomes head) - New_Node - next = node_6". The top dotted arrow line is labeled "push" and points to Node_6, above and to the right. Node_6 reads "(current) head - Node_6 - next = node_5". The bottom dotted arrow line is labeled "pop" and points to a box that reads "gets removed on pop()". Node_6 has a solid arrow that points rightward to Node_5, which reads "Node_5 - next = node_4". Node_5 has a solid arrow pointing rightward to Node_4, which reads "Node_4 - next = node_3". Node_4 has a solid arrow pointing rightward to Node_3, which reads "Node_3 - next = node_2". Node_3 has a solid arrow pointing rightward to Node_2, which reads "Node_2 - next = node_1". Node_2 has a solid arrow pointing rightward to Node_1, which reads "(current) tail - Node_1 - next = None". Node_1 has a dotted arrow pointing rightward to a node that says "None".](https://github.com/exercism/v3-files/blob/main/python/simple-linked-list/linked-list.svg)
![Diagram representing a stack implemented with a linked list. A circle with a dashed border named New_Node is to the far left-hand side, with two dotted arrow lines pointing right-ward. New_Node reads "(becomes head) - New_Node - next = node_6". The top dotted arrow line is labeled "push" and points to Node_6, above and to the right. Node_6 reads "(current) head - Node_6 - next = node_5". The bottom dotted arrow line is labeled "pop" and points to a box that reads "gets removed on pop()". Node_6 has a solid arrow that points rightward to Node_5, which reads "Node_5 - next = node_4". Node_5 has a solid arrow pointing rightward to Node_4, which reads "Node_4 - next = node_3". Node_4 has a solid arrow pointing rightward to Node_3, which reads "Node_3 - next = node_2". Node_3 has a solid arrow pointing rightward to Node_2, which reads "Node_2 - next = node_1". Node_2 has a solid arrow pointing rightward to Node_1, which reads "(current) tail - Node_1 - next = None". Node_1 has a dotted arrow pointing rightward to a node that says "None".](https://media.githubusercontent.com/media/exercism/v3-files/main/python/simple-linked-list/linked-list.svg)
This should not be confused with a [`LIFO` stack using a dynamic array or list][LIFO Stack Array], which may use a `list` underneath.
Dynamic array based `stacks` have a different `head` position and different time complexity (Big-O) and memory footprint.
![Diagram representing a stack implemented with an array/dynamic array. A box with a dashed border named New_Node is to the far right-hand side, with two dotted arrow lines pointing left-ward. New_Node reads "(becomes head) - New_Node". The top dotted arrow line is labeled "append" and points to Node_6, above and to the left. Node_6 reads "(current) head - Node_6". The bottom dotted arrow line is labeled "pop" and points to a box with a dotted outline that reads "gets removed on pop()". Node_6 has a solid arrow that points leftward to Node_5. Node_5 has a solid arrow pointing leftward to Node_4. Node_4 has a solid arrow pointing leftward to Node_3. Node_3 has a solid arrow pointing rightward to Node_2. Node_2 has a solid arrow pointing rightward to Node_1, which reads "(current) tail - Node_1".](https://github.com/exercism/v3-files/blob/main/python/simple-linked-list/linked_list_array.svg)
![Diagram representing a stack implemented with an array/dynamic array. A box with a dashed border named New_Node is to the far right-hand side, with two dotted arrow lines pointing left-ward. New_Node reads "(becomes head) - New_Node". The top dotted arrow line is labeled "append" and points to Node_6, above and to the left. Node_6 reads "(current) head - Node_6". The bottom dotted arrow line is labeled "pop" and points to a box with a dotted outline that reads "gets removed on pop()". Node_6 has a solid arrow that points leftward to Node_5. Node_5 has a solid arrow pointing leftward to Node_4. Node_4 has a solid arrow pointing leftward to Node_3. Node_3 has a solid arrow pointing rightward to Node_2. Node_2 has a solid arrow pointing rightward to Node_1, which reads "(current) tail - Node_1".](https://media.githubusercontent.com/media/exercism/v3-files/main/python/simple-linked-list/linked_list_array.svg)
See these two Stack Overflow questions for some considerations: [Array-Based vs List-Based Stacks and Queues][Stack Overflow: Array-Based vs List-Based Stacks and Queues] and [Differences between Array Stack, Linked Stack, and Stack][Stack Overflow: What is the difference between Array Stack, Linked Stack, and Stack].