Всем привет! Кто мог бы помочь по данным пунктам с кодом? Как его напсиать
a) Write a function create_random_list( N, max ) that takes two integer values ‘N’ and ‘max’ as arguments and returns a linked list with N elements such that the elements have values in the range 0 to max.
b) Write a function sum( list ) that takes a list and returns the sum of the numbers stored in its nodes.
c) Add a variable to the head of the list that keeps track of how many elements the list has each time an element is added or removed. Write a function size( list ) that computes the length of a list using this variable.
d) Write a function that adds a node at the end of a list.
e) Write a function that removes the last node of a list.
f) Write a function that removes the second last node of a list.
g) Write a function reverse( list ) that takes a list and returns a reversed copy.
h) Write a function copy( list ) that takes a list and returns a copy of it.
i) Add a reference to the last node in a list to the list head that keeps track of the reference of the last node whenever a node is appended or removed.
j) Implement a list that does not hold integers, but lists of integers. You only need to implement the class structures and a function that inserts at the head.
a) Write a function create_random_list( N, max ) that takes two integer values ‘N’ and ‘max’ as arguments and returns a linked list with N elements such that the elements have values in the range 0 to max.
b) Write a function sum( list ) that takes a list and returns the sum of the numbers stored in its nodes.
c) Add a variable to the head of the list that keeps track of how many elements the list has each time an element is added or removed. Write a function size( list ) that computes the length of a list using this variable.
d) Write a function that adds a node at the end of a list.
e) Write a function that removes the last node of a list.
f) Write a function that removes the second last node of a list.
g) Write a function reverse( list ) that takes a list and returns a reversed copy.
h) Write a function copy( list ) that takes a list and returns a copy of it.
i) Add a reference to the last node in a list to the list head that keeps track of the reference of the last node whenever a node is appended or removed.
j) Implement a list that does not hold integers, but lists of integers. You only need to implement the class structures and a function that inserts at the head.