Functions - cache

addFirst

Adds a node to the start of the provided linked list.

addLast

Adds a node to the end of the provided linked list.

clear

Clears the provided linked list.

remove

Removes a node from the provided linked list.

removeLast

Removes the last node from the provided linked list.

addFirst

Adds a node to the start of the provided linked list.

Parameters

  • list LinkedList
  • Linked list to which the provided node should be added

  • node Node
  • The node, which should be added to the provided linked list

addLast

Adds a node to the end of the provided linked list.

Parameters

  • list LinkedList
  • Linked list to which the provided node should be added

  • node Node
  • The node, which should be added to the provided linked list

clear

Clears the provided linked list.

Parameters

  • list LinkedList
  • Linked list which should be cleared

remove

Removes a node from the provided linked list.

Parameters

  • list LinkedList
  • Linked list from which the provided node should be removed

  • node Node
  • The node, which should be removed from the provided linked list

removeLast

(LinkedList list)

returns Node?

Removes the last node from the provided linked list.

Parameters

  • list LinkedList
  • Linked list from which the last node should be removed

  • Return Type

    (Node?)
  • Last node of the provided linked list or () if the last node is empty