Doubly-linked list/Definition: Difference between revisions
Content added Content deleted
Line 3,433: | Line 3,433: | ||
(print-it dl) |
(print-it dl) |
||
(display "insertion after the second element: |
(display "insertion after the second element:") |
||
(dllist-insert-after! (dllist-next (dllist-next dl)) 15) |
(dllist-insert-after! (dllist-next (dllist-next dl)) 15) |
||
(print-it dl) |
(print-it dl) |
||
(display "insertion before the second from last element: |
(display "insertion before the second from last element:") |
||
(dllist-insert-before! (dllist-prev (dllist-prev dl)) 45) |
(dllist-insert-before! (dllist-prev (dllist-prev dl)) 45) |
||
(print-it dl) |
(print-it dl) |
||
Line 3,465: | Line 3,465: | ||
insertion after the root: 5 10 20 30 40 50 |
insertion after the root: 5 10 20 30 40 50 |
||
insertion before the root: 5 10 20 30 40 50 55 |
insertion before the root: 5 10 20 30 40 50 55 |
||
insertion after the second element: |
insertion after the second element: 5 10 15 20 30 40 50 55 |
||
insertion before the second from last element: |
insertion before the second from last element: 5 10 15 20 30 40 45 50 55 |
||
removal of the element 30: 5 10 15 20 40 45 50 55 |
removal of the element 30: 5 10 15 20 40 45 50 55 |
||
any node can be used for the generator: 5 10 15 20 40 45 50 55 |
any node can be used for the generator: 5 10 15 20 40 45 50 55 |
||
conversion to a list: (5 10 15 20 40 45 50 55) |
conversion to a list: (5 10 15 20 40 45 50 55) |
||
conversion from a list: "a" "b" "c"</pre> |
conversion from a list: "a" "b" "c"</pre> |
||
=={{header|Swift}}== |
=={{header|Swift}}== |