LMOD

LMOD can be used to mutate the elements in a list

push

About

Time complexity: O(1)
Accept type:

Return type:

Syntax:

  • LMOD <list> push <value>

Appends the element to the end of the provided list

insert

About

Time complexity: O(1)
Accept type:

Return type:

Syntax:

  • LMOD <list> insert <index> <value>

Inserts the element to the provided index, if it is valid while shifting elements to the right if required

pop

About

Time complexity: O(1)
Accept type:

Return type:

Syntax:

  • LMOD <list> pop
  • LMOD <list> pop <index>

Removes the element from the end of the list if no index is provided or from the provided index while shifting elements to the right if required.

remove

About

Time complexity: O(1)
Accept type:

Return type:

Syntax:

  • LMOD <list> remove <index>

Removes the element at the provided index from the list, shifting elements to the right if required.

clear

About

Time complexity: O(n)
Accept type:

Return type:

Syntax:

  • LMOD <list> clear

Removes all the elements present in the list