.. _Links2:
.. raw:: html
.. |--| unicode:: U+2013 .. en dash
.. |---| unicode:: U+2014 .. em dash, trimming surrounding whitespace
:trim:
.. odsalink:: AV/Pointers/linkNodes3CON.css
.. odsalink:: AV/Pointers/linkNodes4CON.css
.. odsalink:: AV/Pointers/linkNodes5CON.css
.. This file is part of the OpenDSA eTextbook project. See
.. http://opendsa.org for more details.
.. Copyright (c) 2012-2020 by the OpenDSA Project Contributors, and
.. distributed under an MIT open source license.
.. avmetadata::
:author: Cliff Shaffer, Mohammed Mostafa, and Margaret Ellis
:requires: Pointer intro
:satisfies:
:topic: Link Nodes
Link Nodes Practice Exercises
=============================
createList
----------
.. extrtoolembed:: 'createList'
:module: Links2
:long_name: createList
:learning_tool: code-workout
:launch_url: https://opendsa-server.cs.vt.edu/lti/launch_extrtool/198790
:id: 118202
One can easily write a loop to iterate through all the Links on a
chain, without needing to know how many there actually are.
.. inlineav:: linkNodes3CON ss
:output: show
iterateOverList
---------------
.. extrtoolembed:: 'iterateOverList'
:module: Links2
:long_name: iterateOverList
:learning_tool: code-workout
:launch_url: https://opendsa-server.cs.vt.edu/lti/launch_extrtool/198791
:id: 118203
One can remove a Link from a chain.
.. inlineav:: linkNodes4CON ss
:output: show
changePointeeNext1
------------------
.. extrtoolembed:: 'changePointeeNext1'
:module: Links2
:long_name: changePointeeNext1
:learning_tool: code-workout
:launch_url: https://opendsa-server.cs.vt.edu/lti/launch_extrtool/198792
:id: 118204
Finally, we can also insert new Links.
.. inlineav:: linkNodes5CON ss
:output: show
addNodeAtHead
-------------
.. extrtoolembed:: 'addNodeAtHead'
:module: Links2
:long_name: addNodeAtHead
:learning_tool: code-workout
:launch_url: https://opendsa-server.cs.vt.edu/lti/launch_extrtool/198793
:id: 118205
.. odsascript:: AV/Pointers/linkNodes3CON.js
.. odsascript:: AV/Pointers/linkNodes4CON.js
.. odsascript:: AV/Pointers/linkNodes5CON.js