Which is the correct code to prepend an item to a list? a) ListPrepend(list, newNode) { if (list-head == null) { list-head = newNode list-tail = new Node } else { list-head-next = new Node list-head = new Node } b) ListPrepend(list, newNode) { if (list-head == null) { list-head = new Node list--tail = new Node } else { newNode--next = list--tail list--tail = newNode} c) ListPrepend(list, newNode) { if (list-head == null) { list-head = new Node list-tail = new Node } else { newNode-next = list --head list-head = new Node } d) ListPrepend(list, newNode) { if (list-head == null) { list-head = new Node list-tail = new Node } else { list-tail--next = new Node list-tail = newNode }

Respuesta :

The correct code is ListPrepend(list, newNode) { if (list-head == null) { list-head = newNode list-tail = newNode } else { newNode--next = list-head list-head = newNode } }.

What are computer codes?

When it comes to computer programming, computer code are known to be a composition of different instructions.

It is often regarded as a system that is made up of sets of rules which are written in a specific programming language.

Note that the code above is the right code as it has the right sequence and no error.

Learn more about Codes from

https://brainly.com/question/22654163